/* ============================================================
   auth.css - Estilos compartilhados das paginas de autenticacao
   (login, register, forgot-password, reset-password, admin-login)
   ============================================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #001f3f 0%, #003366 100%);
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 20px;
    overflow-y: auto;
}

/* Container do card (nomes variam entre as paginas) */
.login-container,
.register-container,
.container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 40px;
    width: 100%;
    max-width: 400px;
    animation: slideIn 0.5s ease-out;
    /* Centraliza verticalmente quando ha espaco e permite rolar
       ate o botao quando o teclado virtual esta aberto */
    margin: auto 0;
}

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

.logo,
.header {
    text-align: center;
    margin-bottom: 30px;
}

.logo-icon {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
}

.logo-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

h1 {
    color: #333;
    font-size: 28px;
    text-align: center;
    margin-bottom: 10px;
}

.subtitle {
    text-align: center;
    color: #666;
    font-size: 14px;
    line-height: 1.5;
}

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

label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
    font-size: 14px;
}

input[type="text"],
input[type="email"],
input[type="password"] {
    width: 100%;
    min-height: 44px;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s ease;
}

input:focus {
    outline: none;
    border-color: #001f3f;
    box-shadow: 0 0 0 3px rgba(0, 31, 63, 0.1);
}

/* Wrapper do campo de senha com botao mostrar/ocultar */
.password-wrapper {
    position: relative;
}

.password-wrapper input {
    padding-right: 52px;
}

.toggle-password {
    position: absolute;
    top: 50%;
    right: 4px;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    color: #666;
    padding: 0;
}

.toggle-password:hover,
.toggle-password:focus-visible {
    color: #333;
}

.toggle-password svg {
    width: 22px;
    height: 22px;
    pointer-events: none;
}

.toggle-password .icon-eye-off {
    display: none;
}

.toggle-password.showing .icon-eye {
    display: none;
}

.toggle-password.showing .icon-eye-off {
    display: block;
}

.btn {
    width: 100%;
    min-height: 44px;
    padding: 14px;
    background: #001f3f;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 31, 63, 0.3);
    opacity: 0.9;
}

.btn:active {
    transform: translateY(0);
}

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

/* Mensagens de erro/sucesso */
.message,
.error-message {
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    display: none;
}

.message.error,
.error-message {
    background: #fee;
    color: #c33;
    border-left: 4px solid #c33;
}

.message.success {
    background: #efe;
    color: #363;
    border-left: 4px solid #363;
}

.message.show,
.error-message.show {
    display: block;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

/* Erro inline junto ao campo (ex.: confirmacao de senha) */
.field-error {
    color: #c33;
    font-size: 13px;
    margin-top: 6px;
}

.password-requirements {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
}

/* Indicacao de campos obrigatorios */
.required-mark {
    color: #c33;
}

.required-note {
    font-size: 12px;
    color: #666;
    margin-bottom: 15px;
}

/* Blocos de links no rodape do card */
.links,
.back-link,
.login-link {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.links a,
.back-link a,
.login-link a {
    color: #001f3f;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

.links a {
    display: block;
    margin: 10px 0;
}

.links a:hover,
.back-link a:hover,
.login-link a:hover {
    text-decoration: underline;
}

.register-link {
    background: #f5f5f5;
    padding: 15px;
    border-radius: 10px;
    margin-top: 20px;
    text-align: center;
}

.register-link p {
    color: #666;
    font-size: 14px;
    margin-bottom: 8px;
}

.register-link a {
    color: #001f3f;
    text-decoration: none;
    font-weight: 600;
}

.register-link a:hover {
    text-decoration: underline;
}

/* Caixa informativa (register) */
.info-box {
    background: #f0f7ff;
    border: 1px solid #cce0ff;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
    font-size: 13px;
    color: #336;
}

.info-box strong {
    display: block;
    margin-bottom: 5px;
}

/* Views de sucesso/erro/carregamento */
.success-view,
.error-view {
    text-align: center;
    display: none;
}

.success-view.show,
.error-view.show {
    display: block;
}

.success-icon {
    width: 80px;
    height: 80px;
    background: #e8f5e9;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 40px;
}

.error-icon {
    width: 80px;
    height: 80px;
    background: #ffebee;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 40px;
}

.form-view {
    display: block;
}

.form-view.hide {
    display: none;
}

.loading-view {
    display: none;
    text-align: center;
    padding: 40px 0;
}

.loading-view.show {
    display: block;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e0e0e0;
    border-top-color: #001f3f;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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