:root {
    --primary-color: #ffffff;
    --secondary-color: #2c3e50;
    --accent-color: #d4af37;
    --hover-color: #ffbf00;
    --band-hover-color: #a3d977;
    --shadow-color: rgba(0, 0, 0, 0.15);
    --border-radius: 12px;

    --bg-light: #f8f9fd;
    --bg-dark: #16213e;
    --gradient-start: #1a1a2e;
    --gradient-end: #16213e;

    /* Success Colors */
    --success-color: #2ecc71;
    --warning-color: #f1c40f;

    /* Border Styles */
    --border-radius: 12px;
    --border-radius-lg: 20px;

    --text-color: #2d3748;
    --input-bg: #f7fafc;
    --input-border: #e2e8f0;
}

/* Base Reset */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Body and Background Setup */
body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: var(--text-color);
    line-height: 1.5;
}

/* Animated Background Elements */
.pwd-bg-element {
    position: fixed;
    border-radius: 50%;
    background: var(--accent-color);
    opacity: 0.05;
    z-index: -1;
    animation: float 15s infinite;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(-30px, 30px) rotate(180deg); }
}

/* Main Container */
.pwd-container {
    width: 100%;
    max-width: 420px;
    perspective: 1000px;
}

/* Form Container */
.pwd-form-container {
    background: var(--primary-color);
    padding: 2.5rem;
    border-radius: var(--border-radius-lg);
    box-shadow: 0 15px 35px var(--shadow-color);
    backdrop-filter: blur(10px);
    transform-style: preserve-3d;
    animation: formEntry 0.6s ease-out;
}

@keyframes formEntry {
    from {
        opacity: 0;
        transform: translateY(20px) rotateX(-10deg);
    }
    to {
        opacity: 1;
        transform: translateY(0) rotateX(0);
    }
}

/* Logo Styles */
.pwd-logo {
    text-align: center;
    margin-bottom: 1.5rem;
}

.pwd-logo img {
    max-width: 160px;
    height: auto;
    filter: drop-shadow(0 4px 6px var(--shadow-color));
    transition: transform 0.3s ease;
}

.pwd-logo img:hover {
    transform: scale(1.05);
}

/* Heading Styles */
h1 {
    color: var(--secondary-color);
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: 1.75rem;
    font-weight: 600;
    position: relative;
}

h1::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 3px;
    background: var(--accent-color);
    border-radius: 2px;
}

/* Form Elements */
.pwd-form-group {
    margin-bottom: 1.25rem;
    position: relative;
}

.pwd-form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-color);
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.9375rem;
}

.pwd-form-group label ion-icon {
    color: var(--accent-color);
    font-size: 1.25rem;
}

/* Input Styles */
.pwd-form-group input:not(.pwd-otp-input) {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--input-border);
    border-radius: var(--border-radius);
    background: var(--input-bg);
    color: var(--text-color);
    font-size: 0.9375rem;
    transition: all 0.3s ease;
}

.pwd-form-group input:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.1);
    outline: none;
}

/* OTP Input Specific Styles */
.pwd-otp-container {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    margin: 1.25rem 0;
}

.pwd-otp-input {
    width: 3.125rem;
    height: 3.125rem;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 600;
    border: 2px solid var(--input-border);
    border-radius: var(--border-radius);
    background: var(--input-bg);
    transition: all 0.3s ease;
}

.pwd-otp-input:focus {
    border-color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(212, 175, 55, 0.15);
}

/* Email Display */
.pwd-email-display {
    background: var(--bg-light);
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius);
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.875rem;
}

/* Timer Styles */
.pwd-timer-container {
    text-align: center;
    margin: 1rem 0;
}

.pwd-otp-timer {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0.5rem 1rem;
    background: var(--bg-light);
    border-radius: var(--border-radius);
    color: var(--secondary-color);
    font-weight: 500;
    font-size: 0.9375rem;
}

.pwd-otp-timer.pwd-expiring {
    color: var(--warning-color);
    animation: pulse 1s infinite;
}

.pwd-otp-timer.pwd-expired {
    color: var(--error-color);
}

/* Button Styles */
.pwd-button-group {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.pwd-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.pwd-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.pwd-btn:hover::before {
    width: 300px;
    height: 300px;
}

.pwd-btn-primary {
    background: var(--accent-color);
    color: var(--primary-color);
    flex: 2;
}

.pwd-text-link {
    color: var(--accent-color);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.875rem;
    transition: color 0.3s ease;
    cursor: pointer;
    padding: 0.5rem;
}

.pwd-text-link:hover {
    color: var(--hover-color);
}

/* Alert Styles */
.pwd-alert {
    padding: 0.875rem 1rem;
    border-radius: var(--border-radius);
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    animation: slideIn 0.3s ease;
}

.pwd-alert ion-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.pwd-alert-error {
    background: #fff5f5;
    color: var(--error-color);
    border: 1px solid #fed7d7;
}

.pwd-alert-success {
    background: #f0fff4;
    color: var(--success-color);
    border: 1px solid #c6f6d5;
}

/* Password Requirements */
.pwd-password-requirements {
    font-size: 0.75rem;
    color: var(--secondary-color);
    opacity: 0.8;
    margin-top: 0.5rem;
}

/* Animations */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (min-width: 1200px) {
    .pwd-container {
        max-width: 450px;
    }

    .pwd-form-container {
        padding: 3rem;
    }
}

@media (max-width: 480px) {
    body {
        padding: 1rem;
    }

    .pwd-form-container {
        padding: 1.5rem;
    }

    .pwd-button-group {
        flex-direction: column;
    }

    .pwd-btn {
        width: 100%;
    }

    .pwd-otp-container {
        gap: 0.5rem;
    }

    .pwd-otp-input {
        width: 2.5rem;
        height: 2.5rem;
        font-size: 1.25rem;
    }

    .pwd-email-display {
        flex-direction: column;
        gap: 0.625rem;
        text-align: center;
    }

    h1 {
        font-size: 1.5rem;
    }
}

/* Accessibility Focus Styles */
:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.3);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-light);
}

::-webkit-scrollbar-thumb {
    background: var(--accent-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--hover-color);
}

/* Password Input Group */
.pwd-password-input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.pwd-password-input-group input {
    padding-right: 2.8125rem;
}

.pwd-toggle-password {
    position: absolute;
    right: 0.625rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.3125rem;
    color: var(--secondary-color);
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.pwd-toggle-password:hover {
    opacity: 1;
}

.pwd-toggle-password ion-icon {
    font-size: 1.25rem;
}

.pwd-hide-icon {
    display: none;
}

.pwd-password-input-group input[type="text"] ~ .pwd-toggle-password .pwd-show-icon {
    display: none;
}

.pwd-password-input-group input[type="text"] ~ .pwd-toggle-password .pwd-hide-icon {
    display: block;
}

/* Loading State */
.pwd-loading {
    position: relative;
    pointer-events: none;
}

.pwd-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 1.25rem;
    height: 1.25rem;
    margin: -0.625rem 0 0 -0.625rem;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Disabled States */
.pwd-btn:disabled,
.pwd-otp-input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Focus Within States */
.pwd-form-group:focus-within label {
    color: var(--accent-color);
}

/* Resend OTP Container and Button Styles */
.pwd-resend-container {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--input-border);
}

.pwd-resend-form {
    display: inline-block;
}

.pwd-btn-resend {
    background: none;
    border: none;
    color: var(--accent-color);
    font-size: 0.9375rem;
    padding: 0.625rem 1.25rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    font-weight: 500;
}

.pwd-btn-resend ion-icon {
    font-size: 1.25rem;
    transition: transform 0.3s ease;
}

.pwd-btn-resend:hover {
    color: var(--hover-color);
    background-color: rgba(212, 175, 55, 0.1);
}

.pwd-btn-resend:hover ion-icon {
    transform: rotate(180deg);
}

.pwd-btn-resend:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    color: var(--secondary-color);
}

.pwd-btn-resend:disabled:hover {
    background-color: transparent;
}

.pwd-btn-resend:disabled ion-icon {
    transform: none;
}

/* Animation for resend container appearance */
.pwd-resend-container {
    animation: fadeSlideUp 0.3s ease;
}

@keyframes fadeSlideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Loading state for resend button */
.pwd-btn-resend.pwd-loading {
    position: relative;
    color: transparent;
}

.pwd-btn-resend.pwd-loading ion-icon {
    display: none;
}

.pwd-btn-resend.pwd-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 1rem;
    height: 1rem;
    margin: -0.5rem 0 0 -0.5rem;
    border: 2px solid var(--accent-color);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Media Queries */
@media (max-width: 480px) {
    .pwd-resend-container {
        margin-top: 1.25rem;
        padding-top: 1.25rem;
    }

    .pwd-btn-resend {
        width: auto;
        font-size: 0.875rem;
        padding: 0.5rem 1rem;
    }
}

/* High Contrast Mode Support */
@media (forced-colors: active) {
    .pwd-btn-resend {
        border: 1px solid currentColor;
    }
}

/* Focus styles for accessibility */
.pwd-btn-resend:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.3);
}