.login-wrapper,
.register-wrapper,
.reset-wrapper,
.confirm-wrapper,
.complete-wrapper,
.message-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px 20px;
}

.login-box,
.register-box,
.reset-box,
.confirm-box,
.complete-box,
.message-box {
    max-width: 450px;
    width: 100%;
    min-height: 560px;
    background: var(--card-bg);
    padding: 40px 32px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--card-border);
    transition: background 0.3s;
    display: flex;
    flex-direction: column;
}

/* Icone de categoria footer/button -> margem top auto para alinhar ao fundo */
.btn-login-submit,
.btn-register-submit,
.btn-reset-submit,
.btn-confirm-submit,
.btn-back-login,
.btn-complete-login,
.login-footer-register,
.register-footer,
.reset-footer {
    margin-top: auto;
}

/* Registro e perfil compartilham o register-box, que comporta mais conteúdo */
.register-box {
    max-width: 640px;
    min-width: 0;
}

.profile-back-link {
    margin-bottom: 18px;
    text-align: left;
}
.profile-back-link a {
    font-size: 14px;
    color: var(--secondary-color);
    text-decoration: none;
    transition: opacity var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.profile-back-link a:hover {
    text-decoration: underline;
    opacity: 0.85;
}

.login-box h2,
.register-box h2,
.reset-box h2,
.confirm-box h2,
.complete-box h2,
.message-box h2 {
    font-size: 24px;
    margin-bottom: 10px;
    color: var(--text-color);
}

.register-box h2,
.reset-box h2,
.confirm-box h2,
.complete-box h2,
.message-box h2 { text-align: center; }

.login-box p,
.register-box p,
.reset-box p,
.confirm-box p,
.complete-box p,
.message-box p {
    font-size: 14px;
    color: var(--text-color);
    opacity: 0.7;
    margin-bottom: 30px;
    line-height: 1.5;
}

.register-box p,
.reset-box p,
.confirm-box p,
.complete-box p,
.message-box p { text-align: center; }

.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-color);
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="email"],
.form-group input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--nav-border);
    background: rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--text-color);
    outline: none;
    transition: border-color var(--transition-fast), background var(--transition-fast);
}
.form-group input:focus {
    border-color: var(--secondary-color);
    background: rgba(255, 255, 255, 0.12);
}

.helptext {
    display: block;
    font-size: 11px;
    color: var(--text-color);
    opacity: 0.6;
    margin-top: 5px;
    line-height: 1.4;
}

.login-utilities-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    font-size: 13px;
}

.remember-me-label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-color);
    cursor: pointer;
    font-weight: normal !important;
}
.remember-me-label input {
    cursor: pointer;
    accent-color: var(--secondary-color);
    width: 16px;
    height: 16px;
}

.forgot-password-link {
    color: var(--text-color);
    opacity: 0.8;
    text-decoration: none;
    transition: opacity var(--transition-fast);
}
.forgot-password-link:hover {
    opacity: 1;
    text-decoration: underline;
}

.btn-login-submit,
.btn-register-submit,
.btn-reset-submit,
.btn-confirm-submit {
    width: 100%;
    background: var(--secondary-color);
    color: var(--text-color);
    border: none;
    padding: 14px;
    min-height: 44px;
    font-size: 15px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    transition: opacity var(--transition-fast), transform var(--transition-smooth);
    will-change: transform;
}

.btn-register-submit,
.btn-confirm-submit { margin-top: auto; }

.btn-login-submit:hover,
.btn-register-submit:hover,
.btn-reset-submit:hover,
.btn-confirm-submit:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.btn-confirm-submit:hover { transform: none; }

.login-footer-register,
.register-footer,
.reset-footer {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid var(--nav-border);
    font-size: 14px;
    color: var(--text-color);
}

.register-footer,
.reset-footer { text-align: center; }

.login-footer-register a,
.register-footer a,
.reset-footer a {
    color: var(--text-color);
    font-weight: 600;
    text-decoration: underline;
}

.error-alert {
    background: #f8d7da;
    color: #721c24;
    padding: 12px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 20px;
    text-align: left;
    border: 1px solid #f5c6cb;
}

.errorlist {
    list-style: none;
    background: #f8d7da;
    color: #721c24;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 15px;
    border: 1px solid #f5c6cb;
}

.btn-back-login {
    display: inline-block;
    width: 100%;
    background: transparent;
    color: var(--text-color) !important;
    border: 2px solid var(--secondary-color);
    padding: 12px;
    min-height: 44px;
    font-size: 15px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    text-decoration: none;
    text-align: center;
    transition: background var(--transition-fast), border-color var(--transition-fast);
    cursor: pointer;
}
.btn-back-login:hover {
    background: var(--secondary-color);
}

.btn-complete-login {
    display: inline-block;
    width: 100%;
    background: var(--secondary-color);
    color: var(--text-color) !important;
    padding: 14px;
    min-height: 44px;
    font-size: 15px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    transition: opacity var(--transition-fast);
}
.btn-complete-login:hover { opacity: 0.9; }

.password-field {
    position: relative;
    width: 100%;
}

.password-field input[type="password"],
.password-field input[type="text"] {
    padding-right: 42px;
}

.password-toggle-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    margin: 0;
    padding: 4px;
    color: var(--text-color);
    opacity: 0.6;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity var(--transition-fast);
    line-height: 0;
}
.password-toggle-btn:hover { opacity: 1; }
.password-toggle-btn:focus { opacity: 1; }
.password-toggle-btn:focus-visible { outline: none; }

@media (max-width: 480px) {
    .login-box,
    .register-box,
    .reset-box,
    .confirm-box,
    .complete-box,
    .message-box { padding: 32px 20px; }
    .login-utilities-row { flex-direction: column; gap: 12px; align-items: flex-start; }
}

@media (max-width: 480px) {
    .profile-tabs {
        gap: 6px;
        margin: 0 0 20px;
        padding: 0 0 10px;
        flex-wrap: nowrap;
    }
    .profile-tab {
        flex: 1 1 0;
        min-width: 0;
        flex-direction: column;
        gap: 4px;
        padding: 8px 6px;
        font-size: 11px;
        white-space: nowrap;
        overflow: hidden;
    }
    .profile-tab-icon {
        width: 18px;
        height: 18px;
    }
    .profile-back-link {
        margin-bottom: 14px;
    }
}

.profile-avatar-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    margin-bottom: 28px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--nav-border);
}

.profile-avatar-preview {
    position: relative;
    width: 96px;
    height: 96px;
    border-radius: 50%;
    border: 3px solid var(--secondary-color);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: color-mix(in srgb, var(--primary-color) 85%, transparent);
    flex-shrink: 0;
    cursor: pointer;
    transition: border-color var(--transition-fast);
}
.profile-avatar-preview:hover {
    border-color: var(--text-color);
}

.profile-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-avatar-placeholder svg {
    width: 48px;
    height: 48px;
    color: var(--text-color);
    opacity: 0.5;
}

.profile-avatar-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    opacity: 0;
    transition: opacity var(--transition-fast);
}
.profile-avatar-preview:hover .profile-avatar-overlay {
    opacity: 1;
}
.profile-avatar-overlay svg {
    width: 22px;
    height: 22px;
}

.profile-avatar-preview input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
}

.profile-avatar-remove {
    color: #dc3545 !important;
    border-color: #dc3545;
}
.profile-avatar-remove:hover {
    background: rgba(220, 53, 69, 0.12);
    border-color: #dc3545;
}

.profile-info-section {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 24px;
}

.profile-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
}

.profile-info-label {
    font-weight: 600;
    color: var(--text-color);
    opacity: 0.8;
}

.profile-info-value {
    color: var(--text-color);
    text-align: right;
    word-break: break-all;
}

.profile-badge-premium {
    background: linear-gradient(135deg, #ffc107, #ffb300);
    color: #111 !important;
    padding: 3px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
}

.profile-danger-link {
    color: #dc3545;
}

.profile-password-section {
    margin-bottom: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--nav-border);
}

.profile-section-title {
    font-size: 16px;
    margin-bottom: 8px;
    color: var(--text-color);
}

.profile-password-section .form-group {
    margin-bottom: 16px;
}

.profile-divider {
    border: none;
    border-top: 1px solid var(--nav-border);
    margin: 24px 0;
}

.profile-danger-zone {
    text-align: left;
}

.profile-section-title-danger {
    color: #dc3545;
}

.btn-delete-account {
    width: 100%;
    background: #dc3545;
    color: #fff;
    border: none;
    padding: 12px 14px;
    min-height: 44px;
    font-size: 14px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: opacity var(--transition-fast), transform var(--transition-smooth);
    will-change: transform;
}
.btn-delete-account:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.profile-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--nav-border);
    padding-bottom: 12px;
    overflow-x: auto;
}

.profile-tab {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: 1px solid var(--nav-border);
    color: var(--text-color);
    opacity: 0.75;
    padding: 9px 18px;
    font-size: 14px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: opacity var(--transition-fast), background var(--transition-fast), border-color var(--transition-fast), transform var(--transition-smooth);
    will-change: transform;
}

.profile-tab-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}
.profile-tab:hover {
    opacity: 1;
    transform: translateY(-1px);
}
.profile-tab.active {
    opacity: 1;
    background: var(--color-primary, #4f46e5);
    border-color: var(--color-primary, #4f46e5);
    color: #fff;
}

.profile-tab-danger {
    border-color: rgba(220, 53, 69, 0.45);
    color: #dc3545;
}
.profile-tab-danger:hover {
    border-color: #dc3545;
    background: rgba(220, 53, 69, 0.08);
}
.profile-tab-danger.active {
    background: #dc3545;
    border-color: #dc3545;
    color: #fff;
}

.profile-tab-panel {
    display: none;
}
.profile-tab-panel.active {
    display: block;
}

.profile-cancel-link {
    display: inline-block;
    margin-top: 14px;
    padding: 10px 18px;
    border: 1px solid #dc3545;
    border-radius: var(--radius-sm);
    color: #dc3545;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: background var(--transition-fast), color var(--transition-fast), transform var(--transition-smooth);
    will-change: transform;
}
.profile-cancel-link:hover {
    background: #dc3545;
    color: #fff;
    transform: translateY(-1px);
}

.profile-subscribe-btn {
    margin-top: 16px;
    text-align: center;
    text-decoration: none;
}

/* Mobile: sem abas — seções empilhadas, separadas por linhas */
@media (max-width: 480px) {
    .profile-tabs {
        display: none;
    }
    .profile-tab-panel,
    .profile-tab-panel.active {
        display: block;
    }
    .profile-tab-panel + .profile-tab-panel,
    .register-box > .profile-tab-panel {
        border-top: 1px solid var(--nav-border);
        padding-top: 24px;
        margin-top: 24px;
    }
}
