/* =========================================================
   Website | Apresentação + Login
   Layout responsivo: fotografia centrada + login lateral
   ========================================================= */

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

:root {
    --background: #f5f7fb;
    --surface: #ffffff;
    --surface-soft: #f8fafc;
    --text: #172033;
    --muted: #64748b;
    --border: #e2e8f0;
    --accent: #4f46e5;
    --accent-dark: #4338ca;
    --success: #16a34a;
    --danger: #dc2626;
    --shadow: 0 24px 70px rgba(15, 23, 42, 0.10);
}

html {
    min-height: 100%;
    background: var(--background);
}

body {
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at 18% 20%, rgba(79, 70, 229, 0.06), transparent 28%),
        radial-gradient(circle at 85% 80%, rgba(148, 163, 184, 0.12), transparent 30%),
        var(--background);
    line-height: 1.6;
}

/* ---------- Estrutura principal ---------- */

.site-shell {
    width: min(1180px, calc(100% - 48px));
    min-height: 100vh;
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr);
    align-items: center;
    gap: clamp(56px, 8vw, 120px);
    padding: 56px 0;
}

.profile-panel,
.login-panel {
    min-width: 0;
}

.profile-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

/* ---------- Apresentação ---------- */

.eyebrow,
.login-eyebrow {
    display: inline-block;
    margin-bottom: 14px;
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.profile-content h1 {
    color: #0f172a;
    font-size: clamp(2.25rem, 4.2vw, 4rem);
    font-weight: 500;
    letter-spacing: -0.045em;
    line-height: 1.03;
    margin-bottom: 22px;
}

.contact-details {
    color: var(--muted);
    font-size: 0.96rem;
    line-height: 1.8;
    margin-bottom: 34px;
}

.contact-details p {
    margin: 0;
}

.contact-details strong {
    color: #334155;
    font-weight: 600;
}

/* A fotografia fica visualmente no centro da coluna esquerda. */
.profile-photo-wrap {
    width: min(100%, 420px);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 6px;
}

.profile-photo {
    display: block;
    width: min(100%, 390px);
    aspect-ratio: 1 / 1;
    object-fit: cover;
    object-position: center;
    border-radius: 4px;
    box-shadow: 0 22px 55px rgba(15, 23, 42, 0.15);
}

/* ---------- Login ---------- */

.login-panel {
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-container {
    width: 100%;
    max-width: 430px;
}

.login-card {
    width: 100%;
    padding: clamp(30px, 4vw, 42px);
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: 18px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
}

.login-header {
    margin-bottom: 30px;
}

.login-eyebrow {
    margin-bottom: 8px;
    color: var(--accent);
    font-size: 0.7rem;
}

.login-header h2 {
    margin-bottom: 7px;
    color: #0f172a;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.login-header p {
    color: var(--muted);
    font-size: 0.9rem;
}

/* ---------- Campos ---------- */

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

.input-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
}

.input-wrapper input {
    width: 100%;
    padding: 17px 16px 9px;
    color: var(--text);
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: 10px;
    outline: none;
    font-size: 16px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-wrapper input::placeholder {
    color: transparent;
}

.input-wrapper label {
    position: absolute;
    left: 16px;
    top: 13px;
    color: var(--muted);
    font-size: 16px;
    pointer-events: none;
    transform-origin: left top;
    transition: all 0.2s ease;
}

.input-wrapper input:focus,
.input-wrapper input:valid,
.input-wrapper input.has-value {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.08);
}

.input-wrapper input:focus + label,
.input-wrapper input:valid + label,
.input-wrapper input.has-value + label {
    color: var(--accent);
    font-weight: 500;
    transform: translateY(-8px) scale(0.875);
}

/* ---------- Palavra-passe ---------- */

.password-wrapper {
    position: relative;
}

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

.password-toggle {
    position: absolute;
    top: 50%;
    right: 10px;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    padding: 8px;
    color: var(--muted);
    background: transparent;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    transform: translateY(-50%);
    transition: color 0.2s ease, background 0.2s ease;
}

.password-toggle:hover {
    color: var(--text);
    background: var(--surface-soft);
}

.eye-icon {
    display: block;
    width: 20px;
    height: 20px;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b' stroke-width='1.5'%3e%3cpath stroke-linecap='round' stroke-linejoin='round' d='M15 12a3 3 0 11-6 0 3 3 0 016 0z'/%3e%3cpath stroke-linecap='round' stroke-linejoin='round' d='M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z'/%3e%3c/svg%3e");
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
}

.eye-icon.show-password {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b' stroke-width='1.5'%3e%3cpath stroke-linecap='round' stroke-linejoin='round' d='M3.98 8.223A10.477 10.477 0 001.934 12C3.226 16.338 7.244 19.5 12 19.5c.993 0 1.953-.138 2.863-.395M6.228 6.228A10.45 10.45 0 0112 4.5c4.756 0 8.773 3.162 10.065 7.498a10.523 10.523 0 01-4.293 5.774M6.228 6.228L3 3m3.228 3.228l3.65 3.65m7.894 7.894L21 21m-3.228-3.228l-3.65-3.65m0 0a3 3 0 11-4.243-4.243m4.242 4.242L9.88 9.88'/%3e%3c/svg%3e");
}

/* ---------- Erros ---------- */

.error-message {
    display: block;
    margin: 4px 0 0 4px;
    color: var(--danger);
    font-size: 0.75rem;
    font-weight: 500;
    opacity: 0;
    transform: translateY(-4px);
    transition: all 0.2s ease;
}

.error-message.show {
    opacity: 1;
    transform: translateY(0);
}

.form-group.error .input-wrapper input {
    border-color: var(--danger);
}

/* ---------- Opções ---------- */

.form-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.remember-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.remember-wrapper input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 0.875rem;
    cursor: pointer;
    user-select: none;
}

.checkmark {
    display: flex;
    flex: 0 0 16px;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    background: var(--surface);
    border: 2px solid #cbd5e1;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.remember-wrapper input[type="checkbox"]:checked ~ .checkbox-label .checkmark {
    background: var(--accent);
    border-color: var(--accent);
}

.remember-wrapper input[type="checkbox"]:checked ~ .checkbox-label .checkmark::after {
    content: "✓";
    color: white;
    font-size: 10px;
    font-weight: 700;
}

.forgot-password,
.signup-link a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.forgot-password {
    font-size: 0.875rem;
}

.forgot-password:hover,
.signup-link a:hover {
    color: var(--accent-dark);
}

/* ---------- Botão ---------- */

.login-btn {
    position: relative;
    width: 100%;
    margin-bottom: 22px;
    padding: 13px 24px;
    color: white;
    background: var(--accent);
    border: 0;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.login-btn:hover {
    background: var(--accent-dark);
}

.login-btn:active {
    transform: translateY(1px);
}

.login-btn.loading {
    pointer-events: none;
    background: #9a9cf0;
}

.btn-text {
    transition: opacity 0.2s ease;
}

.btn-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top-color: white;
    border-radius: 50%;
    opacity: 0;
    transform: translate(-50%, -50%);
    animation: spin 1s linear infinite;
}

.login-btn.loading .btn-text {
    opacity: 0;
}

.login-btn.loading .btn-loader {
    opacity: 1;
}

/* ---------- Registo / sucesso ---------- */

.signup-link {
    text-align: center;
}

.signup-link p {
    color: var(--muted);
    font-size: 0.875rem;
}

.success-message {
    display: none;
    padding: 32px 20px;
    text-align: center;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.success-message.show {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.success-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    margin: 0 auto 16px;
    color: white;
    background: var(--success);
    border-radius: 50%;
    font-size: 20px;
    animation: successPulse 0.5s ease;
}

.success-message h3 {
    margin-bottom: 8px;
    color: #0f172a;
    font-size: 1.25rem;
}

.success-message p {
    color: var(--muted);
    font-size: 0.875rem;
}

/* ---------- Acessibilidade / animações ---------- */

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 4px;
}

@keyframes spin {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes successPulse {
    0% { transform: scale(0); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* ---------- Responsivo ---------- */

@media (max-width: 900px) {
    .site-shell {
        grid-template-columns: 1fr;
        gap: 44px;
        padding: 42px 0 56px;
    }

    .profile-content h1 {
        font-size: clamp(2.2rem, 7vw, 3.4rem);
    }

    .profile-photo {
        width: min(100%, 350px);
    }

    .login-panel {
        width: 100%;
    }

    .login-container {
        max-width: 520px;
    }
}

@media (max-width: 520px) {
    .site-shell {
        width: min(100% - 28px, 520px);
        gap: 34px;
        padding: 28px 0 40px;
    }

    .profile-content h1 {
        font-size: 2.15rem;
    }

    .contact-details {
        font-size: 0.9rem;
        margin-bottom: 24px;
    }

    .profile-photo {
        width: min(100%, 300px);
    }

    .login-card {
        padding: 26px 22px;
        border-radius: 14px;
    }

    .login-header h2 {
        font-size: 1.7rem;
    }

    .form-options {
        align-items: flex-start;
        flex-direction: column;
    }
}

@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;
    }
}


/* =========================================================
   Proteção visual da fotografia
   Impede seleção e arrastamento normal da imagem.
   Nota: isto é uma barreira contra utilização casual, não
   uma proteção absoluta contra cópia na web.
   ========================================================= */

.protected-image {
    -webkit-user-drag: none;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    pointer-events: none;
}
