@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --seu-green: #1e7e54;
    --seu-green-hover: #166542;
    --seu-green-glow: rgba(30, 126, 84, 0.2);
    --seu-dark-blue: #1b3d6c;
    
    --card-bg: #ffffff;
    --text-primary: #1f2937;
    --text-secondary: #4b5563;
    --text-muted: #9ca3af;
    
    --input-border: #d1d5db;
    --input-focus: #1e7e54;
    --bg-overlay: rgba(0, 0, 0, 0.58);
    
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
    
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Global Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-family);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

html {
    height: 100%;
    scroll-behavior: smooth;
    text-size-adjust: 100%;
    -webkit-text-size-adjust: 100%;
}

body {
    background: linear-gradient(var(--bg-overlay), var(--bg-overlay)), 
                url('../images/seu_background.webp') no-repeat center center fixed;
    background-size: cover;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    position: relative;
    overflow-x: hidden;
    color: var(--text-primary);
}

/* Main Responsive Flex Wrapper */
.seu-main-wrapper {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: clamp(16px, 4vw, 40px) 16px;
    z-index: 1;
}

/* White Login/Reset Card Container */
.container {
    width: 100%;
    max-width: 470px;
    background: var(--card-bg);
    border-radius: 16px;
    padding: clamp(24px, 5vw, 40px);
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.32), 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(0);
    animation: fadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(18px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Header & SEU Logo */
.header {
    text-align: center;
    border-bottom: 1px solid #f0f1f3;
    padding-bottom: 20px;
    margin-bottom: 24px;
}

.logo-container {
    display: flex;
    justify-content: center;
    align-items: center;
}

.seu-logo-badge {
    height: clamp(75px, 16vw, 115px);
    width: auto;
    max-width: 100%;
    object-fit: contain;
    transition: var(--transition);
}

.seu-logo-badge:hover {
    transform: scale(1.03);
}

.title {
    font-size: clamp(17px, 4vw, 20px);
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 12px;
    letter-spacing: -0.2px;
    line-height: 1.35;
}

.subtitle {
    display: none;
}

/* Step Progress Indicator */
.step-indicator {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
    padding: 0 2px;
    position: relative;
}

.step-dot {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 2;
    flex-shrink: 0;
}

.step-number {
    width: clamp(28px, 6vw, 32px);
    height: clamp(28px, 6vw, 32px);
    border-radius: 50%;
    background: #f3f4f6;
    color: var(--text-secondary);
    font-size: clamp(11px, 2.5vw, 13px);
    font-weight: 600;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 2px solid #e5e7eb;
    transition: var(--transition);
}

.step-text {
    font-size: clamp(9.5px, 2.4vw, 11.5px);
    font-weight: 500;
    color: var(--text-muted);
    margin-top: 6px;
    transition: var(--transition);
    text-align: center;
    white-space: nowrap;
}

.step-line {
    height: 2px;
    background: #e5e7eb;
    flex-grow: 1;
    margin-bottom: 18px;
    z-index: 1;
    transition: var(--transition);
}

.step-dot.active .step-number {
    background: #ffffff;
    color: var(--seu-green);
    border-color: var(--seu-green);
    box-shadow: 0 0 0 4px var(--seu-green-glow);
}

.step-dot.active .step-text {
    color: var(--seu-green);
    font-weight: 600;
}

.step-dot.completed .step-number {
    background: var(--seu-green);
    color: #ffffff;
    border-color: var(--seu-green);
}

.step-dot.completed .step-text {
    color: var(--seu-green);
}

.step-line.active {
    background: var(--seu-green);
}

/* Forms & Inputs */
.form-step {
    display: none;
}

.form-step.active {
    display: block;
    animation: stepSlideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes stepSlideIn {
    from {
        opacity: 0;
        transform: translateX(12px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.form-group {
    margin-bottom: 20px;
    position: relative;
}

.label-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

label {
    display: block;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

input {
    width: 100%;
    padding: 12px 14px;
    background: #ffffff;
    border: 1px solid var(--input-border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 16px; /* 16px prevents mobile browser auto-zoom (iOS Safari) */
    font-weight: 400;
    transition: var(--transition);
    outline: none;
    appearance: none;
    -webkit-appearance: none;
}

@media (min-width: 769px) {
    input {
        font-size: 14px;
        padding: 10px 14px;
    }
}

input:focus {
    border-color: var(--input-focus);
    box-shadow: 0 0 0 3.5px var(--seu-green-glow);
}

input::placeholder {
    color: #9ca3af;
}

.input-icon {
    display: none;
}

.btn-toggle-password {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 6px;
    transition: var(--transition);
}

.btn-toggle-password:hover {
    color: var(--text-primary);
    background: rgba(0, 0, 0, 0.04);
}

.btn-toggle-password svg {
    width: 20px;
    height: 20px;
}

/* Primary & Secondary Buttons */
.btn-submit {
    width: 100%;
    min-height: 46px;
    padding: 12px 16px;
    background: var(--seu-green);
    border: none;
    border-radius: 8px;
    color: #ffffff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    touch-action: manipulation;
}

.btn-submit:hover:not(:disabled) {
    background: var(--seu-green-hover);
    box-shadow: 0 4px 14px rgba(30, 126, 84, 0.3);
}

.btn-submit:active:not(:disabled) {
    transform: scale(0.985);
}

.btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-resend {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    min-height: 44px;
    text-align: center;
    background: transparent;
    border: 1px solid var(--input-border);
    color: var(--text-secondary);
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    margin-top: 10px;
    transition: var(--transition);
    touch-action: manipulation;
}

.btn-resend:hover:not(:disabled) {
    background: #f9fafb;
    color: var(--text-primary);
    border-color: var(--text-muted);
}

.btn-resend:active:not(:disabled) {
    transform: scale(0.985);
}

.btn-resend:disabled {
    color: var(--text-muted);
    cursor: not-allowed;
    opacity: 0.65;
}

/* Password Strength & Requirements Checklist */
.password-strength-container {
    margin-top: -8px;
    margin-bottom: 20px;
    padding: 0 2px;
}

.strength-bar-wrapper {
    height: 5px;
    background: #e5e7eb;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 8px;
}

.strength-bar {
    height: 100%;
    width: 0%;
    background: var(--error);
    transition: width 0.3s ease-out, background-color 0.3s ease-out;
}

.strength-label-text {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
    display: flex;
    justify-content: space-between;
}

.strength-name {
    font-weight: 600;
}

.requirements-checklist {
    list-style: none;
    margin-top: 12px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

@media (max-width: 380px) {
    .requirements-checklist {
        grid-template-columns: 1fr;
        gap: 6px;
    }
}

.requirement-item {
    font-size: 11px;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
    line-height: 1.3;
}

.requirement-item.valid {
    color: var(--seu-green);
    font-weight: 500;
}

.requirement-item .dot {
    width: 6px;
    height: 6px;
    background: #9ca3af;
    border-radius: 50%;
    flex-shrink: 0;
    transition: var(--transition);
}

.requirement-item.valid .dot {
    background: var(--seu-green);
    box-shadow: 0 0 6px var(--seu-green);
}

/* OTP Info Message */
.otp-info-message {
    font-size: 13px;
    color: var(--text-secondary);
    background: #f8fafc;
    border-left: 3.5px solid var(--seu-green);
    padding: 12px 14px;
    border-radius: 6px;
    margin-bottom: 20px;
    line-height: 1.45;
}

#display-masked-mobile {
    direction: ltr;
    display: inline-block;
    unicode-bidi: embed;
    letter-spacing: 0.5px;
}

/* Notification Banners */
.notification-banner {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px;
    border-radius: 8px;
    margin-bottom: 20px;
    animation: fadeIn 0.3s ease-out;
    border: 1px solid transparent;
}

.notification-banner.hidden {
    display: none !important;
}

.notification-banner-icon {
    display: flex;
    align-items: center;
    margin-top: 2px;
    flex-shrink: 0;
}

.notification-banner-icon svg {
    width: 18px;
    height: 18px;
}

.notification-banner-content {
    flex: 1;
}

.notification-banner-title {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 2px;
}

.notification-banner-desc {
    font-size: 12px;
    line-height: 1.4;
}

.notification-banner.success {
    background: #ecfdf5;
    border-color: #a7f3d0;
    color: #065f46;
}

.notification-banner.success .notification-banner-icon {
    color: #10b981;
}

.notification-banner.error {
    background: #fef2f2;
    border-color: #fca5a5;
    color: #991b1b;
}

.notification-banner.error .notification-banner-icon {
    color: #ef4444;
}

/* Loading Overlay */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(4px);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    padding: 20px;
    text-align: center;
}

.loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

.spinner {
    width: 42px;
    height: 42px;
    border: 3.5px solid #e5e7eb;
    border-top: 3.5px solid var(--seu-green);
    border-radius: 50%;
    animation: spin 0.85s linear infinite;
    margin-bottom: 14px;
}

.loading-text {
    font-size: 13.5px;
    color: var(--text-secondary);
    font-weight: 500;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* reCAPTCHA Responsive Container */
.recaptcha-wrapper {
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    overflow: hidden;
}

@media (max-width: 360px) {
    .recaptcha-wrapper iframe,
    .g-recaptcha {
        transform: scale(0.82);
        transform-origin: center center;
    }
}

/* Universal Page Footer */
.seu-page-footer {
    width: 100%;
    min-height: 60px;
    padding: 12px 40px;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    z-index: 5;
}

/* Social links */
.seu-social-links {
    display: flex;
    align-items: center;
    gap: 12px;
}

.seu-social-icon {
    width: 30px;
    height: 30px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #ffffff;
    transition: var(--transition);
    text-decoration: none;
}

.seu-social-icon:hover {
    background: #ffffff;
    color: var(--seu-dark-blue);
    border-color: #ffffff;
    transform: translateY(-2px);
}

.seu-social-icon svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

/* Copyright text */
.seu-copyright {
    color: rgba(255, 255, 255, 0.9);
    font-size: 11.5px;
    font-weight: 400;
    text-align: center;
}

/* Language selector */
.seu-language-selector {
    display: flex;
    align-items: center;
    gap: 8px;
}

.seu-flag {
    width: 18px;
    height: 12px;
    object-fit: cover;
    border-radius: 1px;
    flex-shrink: 0;
}

.seu-lang-select {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.9);
    font-size: 11.5px;
    font-weight: 400;
    cursor: pointer;
    outline: none;
    padding-right: 4px;
}

.seu-lang-select option {
    background: #1e293b;
    color: #ffffff;
}

/* RTL Layout Enhancements */
html[dir="rtl"] input {
    text-align: right;
}

html[dir="rtl"] .input-wrapper input {
    padding-left: 44px;
    padding-right: 14px;
}

html[dir="rtl"] .btn-toggle-password {
    right: auto;
    left: 6px;
}

html[dir="rtl"] .requirement-item {
    flex-direction: row-reverse;
    justify-content: flex-end;
}

html[dir="rtl"] .otp-info-message {
    border-left: none;
    border-right: 3.5px solid var(--seu-green);
}

/* Responsive Breakpoints */

/* Mobile & Tablet Devices (<= 768px) */
@media (max-width: 768px) {
    body {
        background-attachment: scroll; /* fixes lag/overflow on mobile browsers */
    }
    
    .seu-main-wrapper {
        padding: 20px 12px;
    }
    
    .container {
        border-radius: 14px;
        padding: 28px 20px;
    }
    
    .seu-page-footer {
        flex-direction: column;
        padding: 16px 20px max(16px, env(safe-area-inset-bottom)) 20px;
        gap: 14px;
        height: auto;
        text-align: center;
    }

    .seu-social-links {
        justify-content: center;
    }

    .seu-language-selector {
        justify-content: center;
    }
}

/* Small Mobile Phones (<= 480px) */
@media (max-width: 480px) {
    .container {
        padding: 24px 16px;
    }
    
    .header {
        padding-bottom: 16px;
        margin-bottom: 20px;
    }
    
    .title {
        font-size: 17px;
    }
    
    .step-indicator {
        margin-bottom: 22px;
    }
    
    .step-line {
        margin-bottom: 16px;
    }
}

/* Extra Small Phones (<= 340px) */
@media (max-width: 340px) {
    .seu-main-wrapper {
        padding: 12px 8px;
    }

    .container {
        padding: 20px 12px;
        border-radius: 12px;
    }

    .step-text {
        font-size: 9px;
    }
}

/* Landscape Mode for Small Height Devices */
@media (max-height: 600px) and (orientation: landscape) {
    .seu-main-wrapper {
        padding: 12px;
    }

    .seu-logo-badge {
        height: 60px;
    }

    .header {
        padding-bottom: 12px;
        margin-bottom: 16px;
    }

    .container {
        padding: 20px 24px;
    }
}

/* Accessibility: Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *, ::before, ::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
