* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    outline: none;
    border: none;
    transition: all ease .3s;
}

.theme-switcher {
    top: 1.5rem
}

body {
    font-size: 16px;
    font-family: var(--font-primary);
    display: flex;
    justify-content: center;
    background-color: var(--clr-background);
    padding: 2rem;
    color: var(--clr-text-primary);
    min-height: 100dvh;
}

@keyframes fadeInSlideUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.Container {
    background-color: var(--clr-background-alt);
    border-radius: var(--border-radius);
    box-shadow: 0 10px 30px var(--clr-shadow);
    padding: 25px;
    transition: var(--transition);
    width: 90dvw;
    height: max-content;
    animation: fadeInSlideUp 1s ease;
}

figure {
    display: flex;
    align-items: center;
    justify-content: start;
    flex-wrap: wrap;
    padding-bottom: 10px;
    margin-bottom: 10px;
}

figure div {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

figure .lower {
    color: var(--clr-text-muted);
    font-weight: 500;
    margin-top: 0.4rem;
}

form {
    padding: 15px;
    font-size: 1.2rem;
    font-weight: 600;
    display: flex;
    justify-content: center;
    flex-direction: column;
    gap: 1rem;
}

.input {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    flex-direction: column;
    gap: 18px;
    position: relative;
}

.input .icon {
    font-size: 1rem;
    display: grid;
    place-items: center;
    position: absolute;
    left: 25px;
    top: 50%;
    transform: translate(-50%, -50%);
    color: var(--clr-text-muted);
    z-index: 2;
    pointer-events: none;
}

.input input:not([type="submit"]):not([type="hidden"]) {
    width: 100%;
    padding: 12px 12px 12px 50px;
    border: 1px solid var(--clr-border);
    border-radius: 10px;
    font-size: 1.1rem;
    transition: var(--transition);
    font-family: var(--font-primary);
    font-weight: 500;
    color: var(--clr-text-primary);
    background-color: var(--clr-background);
    transition: border-color 0.3s ease, background-color 0.3s ease;
}

.input input::placeholder {
    color: var(--clr-text-muted);
    font-weight: 500;
}

.input input:focus {
    outline: none;
    border-color: var(--clr-accent-primary);
    box-shadow: 0 0 0 2px var(--clr-accent-primary);
}

.pairs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.3rem;
}

/* Password */
.password {
    position: relative;
}

.password>i {
    font-size: 1rem;
    display: grid;
    place-items: center;
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--clr-text-muted);
    cursor: pointer;
    z-index: 2;
}

input[type="submit"] {
    background: var(--gradient);
    color: white;
    width: 100%;
    padding: 12px;
    border-radius: 10px;
    font-size: 1.1rem;
    transition: var(--transition);
    font-family: var(--font-primary);
    font-weight: 600;
    cursor: pointer;
}

input[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px var(--clr-shadow-hover);
}

footer {
    padding-top: 10px;
    margin: 10px 0 0 0;
    display: flex;
    justify-content: center;
    gap: 0.3rem;
    font-size: 1rem;
    font-weight: 600;
    width: 100%;
    color: var(--clr-text-secondary);
}

footer button {
    color: var(--clr-accent-primary);
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    border: none;
    background: transparent;
    font-family: var(--font-primary);
    cursor: pointer;
}

footer button:hover {
    color: var(--clr-accent-secondary);
    text-decoration: underline;
}

/* Password Strength Indicator */
.password-strength {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    padding: 0.5rem 0.8rem;
    background: var(--clr-background);
    border-radius: 6px;
    border: 1px solid var(--clr-border);
    grid-column: 1 / -1;
}

.strength-label {
    color: var(--clr-text-secondary);
    font-weight: 600;
    min-width: 50px;
}

.strength-text {
    color: var(--clr-text-primary);
    font-weight: 600;
}

.strength-bar {
    flex: 1;
    height: 6px;
    background: var(--clr-border);
    border-radius: 3px;
    overflow: hidden;
}

.strength-fill {
    height: 100%;
    width: 0%;
    transition: all 0.3s ease;
    border-radius: 3px;
}

.weak .strength-fill {
    background-color: var(--clr-danger);
    width: 33%;
}

.medium .strength-fill {
    background-color: var(--clr-warning);
    width: 66%;
}

.strong .strength-fill {
    background-color: var(--clr-success);
    width: 100%;
}

.weak .strength-text {
    color: var(--clr-danger);
}

.medium .strength-text {
    color: var(--clr-warning);
}

.strong .strength-text {
    color: var(--clr-success);
}

/* Password Warning */
.password-warning {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(220, 53, 69, 0.08);
    border: 1px solid rgba(220, 53, 69, 0.3);
    border-radius: 8px;
    padding: 0.8rem 1rem;
    color: var(--clr-danger);
    font-size: 0.9rem;
    font-weight: 500;
    animation: fadeIn 0.3s ease;
    grid-column: 1 / -1;
}

.password-warning.hidden {
    display: none;
}

.password-warning i {
    font-size: 1rem;
}

.password-warning a {
    color: var(--clr-accent-primary);
    text-decoration: underline;
    cursor: pointer;
    font-weight: 600;
    margin-left: auto;
    transition: color 0.3s;
}

.password-warning a:hover {
    color: var(--clr-accent-secondary);
}

/* --- Custom Dropdown Styles --- */
.custom-select-container {
    position: relative;
}

.select-trigger {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 12px 12px 12px 50px;
    border: 1px solid var(--clr-border);
    border-radius: 10px;
    font-size: 1.1rem;
    transition: var(--transition);
    font-family: var(--font-primary);
    font-weight: 500;
    color: var(--clr-text-muted);
    background-color: var(--clr-background);
    cursor: pointer;
    user-select: none;
}

.select-trigger.selection-made {
    color: var(--clr-text-primary);
}

.custom-select-container.active .select-trigger {
    border-color: var(--clr-accent-primary);
    box-shadow: 0 0 0 2px var(--clr-accent-primary);
}

/* The Arrow */
.select-trigger .arrow {
    font-size: 0.9rem;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    color: var(--clr-text-muted);
}

.custom-select-container.active .select-trigger .arrow {
    transform: rotate(180deg);
    color: var(--clr-accent-primary);
}

/* The Options Dropdown */
.options-container {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    width: 100%;
    background-color: var(--clr-background-alt);
    border: 1px solid var(--clr-border);
    border-radius: 12px;
    box-shadow: 0 10px 25px var(--clr-shadow);
    overflow: hidden;
    z-index: 100;

    /* Animation States */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-15px);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.custom-select-container.active .options-container {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.option {
    padding: 14px 20px;
    cursor: pointer;
    color: var(--clr-text-primary);
    font-weight: 500;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--clr-border);
    transition: all 0.3s ease;
}

.option i {
    width: 24px;
    text-align: center;
    color: var(--clr-text-muted);
    transition: color 0.3s ease;
}

.option:last-child {
    border-bottom: none;
}

/* Hover Effect */
.option:hover {
    background-color: var(--clr-background);
    color: var(--clr-accent-primary);
}

.option:hover i {
    color: var(--clr-accent-primary);
}

/* Improved Password Generator Dialog - Wider Design */
.password-generator-dialog {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100dvh;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
    padding: 1rem;
}

.password-generator-dialog.active {
    display: flex;
}

.dialog-content {
    background: var(--clr-background-alt);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 25px 50px var(--clr-shadow);
    animation: fadeInSlideUp 0.4s ease;
    position: relative;
}

.dialog-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.dialog-header h3 {
    font-size: 1.5rem;
    color: var(--clr-text-primary);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.dialog-header h3 i {
    color: var(--clr-accent-primary);
    font-size: 1.3rem;
}

.close-dialog {
    background: none;
    color: var(--clr-text-muted);
    font-size: 1.4rem;
    cursor: pointer;
    transition: all 0.3s;
    padding: 0.75rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
}

.close-dialog:hover {
    color: var(--clr-danger);
    background: rgba(220, 53, 69, 0.1);
    transform: rotate(90deg);
}

.generated-password {
    background: var(--clr-background);
    border: 2px solid var(--clr-border);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    font-size: 1.4rem;
    text-align: center;
    margin: 2rem 0;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
    font-family: var(--font-primary);
    font-weight: 600;
    word-break: break-all;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.generated-password:hover {
    border-color: var(--clr-accent-primary);
    box-shadow: var(--card-shadow);
}

.generated-password.copied {
    background: var(--clr-success);
    color: white;
    border-color: var(--clr-success);
}

.copy-indicator {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--clr-success);
    color: white;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    border-radius: 0 var(--border-radius) 0 var(--border-radius);
    opacity: 0;
    transform: translateY(-100%);
    transition: all 0.3s;
    font-weight: 600;
}

.generated-password.copied .copy-indicator {
    opacity: 1;
    transform: translateY(0);
}

.password-options {
    background: var(--clr-background);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin: 1.5rem 0;
    border: 1px solid var(--clr-border);
}

.option-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.option-row:last-child {
    margin-bottom: 0;
}

.option-label {
    font-size: 1rem;
    color: var(--clr-text-primary);
    font-weight: 500;
}

.option-value {
    font-size: 1.1rem;
    color: var(--clr-accent-primary);
    font-weight: 600;
}

.dialog-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.dialog-actions button {
    font-family: var(--font-primary);
    flex: 1;
    padding: .7rem;
    border-radius: var(--border-radius);
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    font-size: 1.1rem;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 60px;
}

.generate-btn {
    background: var(--clr-accent-primary);
    color: white;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
}

.generate-btn:hover {
    background: #0069D9;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 123, 255, 0.4);
}

.use-btn {
    background: var(--clr-success);
    color: white;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.use-btn:hover {
    background: #218838;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(40, 167, 69, 0.4);
}

.password-stats {
    display: flex;
    justify-content: space-around;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--clr-border);
}

.stat {
    text-align: center;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--clr-accent-primary);
}

.stat-label {
    font-size: 0.9rem;
    color: var(--clr-text-secondary);
    margin-top: 0.25rem;
}

/* Background Elements */
.background-elements {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.bg-element {
    position: absolute;
    border-radius: 50%;
    background: linear-gradient(135deg,
            rgba(0, 123, 255, 0.08),
            rgba(40, 167, 69, 0.08));
    filter: blur(40px);
}

.bg-1 {
    width: 280px;
    height: 280px;
    top: -80px;
    left: -80px;
    animation: floatSlow 18s ease-in-out infinite;
}

.bg-2 {
    width: 220px;
    height: 220px;
    bottom: -80px;
    right: -80px;
    animation: floatSlow 22s ease-in-out infinite reverse;
}

.bg-3 {
    width: 160px;
    height: 160px;
    top: 40%;
    right: 15%;
    animation: floatSlow 26s ease-in-out infinite;
}

@keyframes floatSlow {

    0%,
    100% {
        transform: translate(0, 0) rotate(0deg);
    }

    33% {
        transform: translate(20px, 20px) rotate(120deg);
    }

    66% {
        transform: translate(-15px, 15px) rotate(240deg);
    }
}

.field-error {
    background-color: rgba(255, 68, 68, 0.05) !important;
}

.field-success {
    background-color: rgba(0, 200, 81, 0.05) !important;
}

/* Custom select validation */
.custom-select-container.field-error .select-trigger {
    background-color: rgba(255, 68, 68, 0.05) !important;
}

.custom-select-container.field-success .select-trigger {
    background-color: rgba(0, 200, 81, 0.05) !important;
}

@media screen and (max-width: 800px) {

    .pairs {
        grid-template-columns: 1fr;
    }

    .theme-switcher {
        top: 1rem;
        right: 1rem;
    }

    body {
        padding: 0;
        display: block;
        width: 100dvw;
        height: 100dvh;
        position: relative;
        background-color: var(--clr-background-alt);
    }

    .lower {
        text-align: center;
    }

    .Container {
        background: none;
        border-radius: 0;
        box-shadow: none;
        padding: 0;
        height: 100%;
        width: 100%;
        display: flex;
        flex-direction: column;
    }

    figure {
        width: 100%;
        padding: 1rem;
        margin: 0.4rem 0 0 0;
    }

    form {
        padding: 1rem;
        width: 100%;
        flex: 1;
        display: flex;
        flex-direction: column;
        gap: 1.5rem;
        justify-content: flex-start;
    }

    .input {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }

    input[type="submit"],
    .forget {
        margin-top: auto;
        width: 100%;
    }

    .password-generator-dialog {
        padding: 0.5rem;
    }

    .dialog-content {
        padding: 1.5rem;
        width: 95%;
        max-width: 95%;
        margin: 0;
    }

    .dialog-actions {
        flex-direction: column;
        gap: 1rem;
    }

    .password-stats {
        flex-direction: column;
        gap: 1rem;
    }

    .generated-password {
        font-size: 1.1rem;
        padding: 1rem;
        margin: 1rem 0;
    }

    footer {
        position: static;
        margin-top: auto;
        margin-bottom: 0;
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 0.3rem;
        width: 100%;
        border-top: 1px solid var(--clr-border);
    }
}