@import url('tokens.css');

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body.bma-login-body {
    font-family: var(--bma-font);
    background: var(--bma-bg);
    color: var(--bma-text);
    min-height: 100vh;
    line-height: 1.5;
}

a {
    color: var(--bma-blue);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.bma-container {
    max-width: var(--bma-container);
    margin: 0 auto;
    padding: 0 24px;
}

/* ── Top info bar ── */
.bma-topbar {
    background: var(--bma-navy);
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.75rem;
    padding: 8px 0;
}

.bma-topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.bma-topbar-contacts {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.bma-topbar-item {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.bma-topbar-item svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    opacity: 0.85;
}

.bma-topbar-social {
    display: flex;
    align-items: center;
    gap: 10px;
}

.bma-topbar-social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    color: var(--bma-white);
    transition: background 0.2s;
}

.bma-topbar-social a:hover {
    background: rgba(255, 255, 255, 0.22);
    text-decoration: none;
}

.bma-topbar-social svg {
    width: 14px;
    height: 14px;
}

/* ── Header / Navbar ── */
.bma-header {
    background: var(--bma-white);
    box-shadow: 0 1px 0 var(--bma-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.bma-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    gap: 24px;
}

.bma-logo img {
    height: 56px;
    width: auto;
    display: block;
}

.bma-nav {
    display: flex;
    align-items: center;
    gap: 28px;
    list-style: none;
}

.bma-nav a {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--bma-text);
    text-decoration: none;
    transition: color 0.2s;
}

.bma-nav a:hover,
.bma-nav a.active {
    color: var(--bma-blue);
    text-decoration: none;
}

.bma-nav a.nav-contact {
    color: var(--bma-green);
}

.bma-btn-enroll {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--bma-green);
    color: var(--bma-white);
    border: none;
    border-radius: var(--bma-radius);
    font-size: 0.875rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.2s;
}

.bma-btn-enroll:hover {
    background: var(--bma-green-dark);
    text-decoration: none;
    color: var(--bma-white);
}

.bma-btn-enroll svg {
    width: 16px;
    height: 16px;
}

/* ── Main login section ── */
.bma-login-main {
    padding: 40px 0 32px;
}

.bma-login-card {
    background: var(--bma-white);
    border-radius: var(--bma-radius-xl);
    box-shadow: var(--bma-shadow-lg);
    display: grid;
    grid-template-columns: 1fr 1fr;
    overflow: hidden;
    min-height: 520px;
}

/* Left welcome panel */
.bma-welcome-panel {
    padding: 40px 36px 32px;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--bma-border);
}

.bma-welcome-panel h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--bma-navy);
    margin-bottom: 8px;
}

.bma-welcome-panel > p {
    font-size: 0.875rem;
    color: var(--bma-text-muted);
    line-height: 1.6;
    margin-bottom: 16px;
}

.bma-welcome-illustration {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 0;
}

.bma-welcome-illustration img,
.bma-welcome-illustration svg {
    max-width: 100%;
    max-height: 280px;
    height: auto;
}

.bma-feature-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid var(--bma-border);
}

.bma-feature-item {
    text-align: center;
}

.bma-feature-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bma-green-light);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 8px;
    color: var(--bma-green);
}

.bma-feature-icon svg {
    width: 20px;
    height: 20px;
}

.bma-feature-item h3 {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--bma-navy);
    margin-bottom: 2px;
}

.bma-feature-item p {
    font-size: 0.625rem;
    color: var(--bma-text-muted);
    line-height: 1.4;
}

/* Right form panel */
.bma-form-panel {
    padding: 40px 36px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.bma-role-toggle {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    padding: 4px;
    background: var(--bma-bg-light);
    border: 1px solid var(--bma-border);
    border-radius: var(--bma-radius);
}

.bma-role-toggle-btn {
    flex: 1;
    border: none;
    background: transparent;
    padding: 8px 12px;
    font-family: inherit;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--bma-text-muted);
    border-radius: 6px;
    cursor: pointer;
    line-height: 1.3;
}

.bma-role-toggle-btn:hover {
    color: var(--bma-navy);
}

.bma-role-toggle-btn.is-active {
    background: var(--bma-navy);
    color: var(--bma-white);
}

.bma-form-panel h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--bma-navy);
    margin-bottom: 6px;
}

.bma-form-panel > .bma-form-subtitle {
    font-size: 0.875rem;
    color: var(--bma-text-muted);
    margin-bottom: 28px;
}

.bma-form-group {
    margin-bottom: 20px;
}

.bma-form-group label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--bma-text);
    margin-bottom: 6px;
}

.bma-input-wrap {
    position: relative;
}

.bma-input-wrap .bma-input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--bma-text-light);
    pointer-events: none;
}

.bma-input-wrap .bma-toggle-pwd {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: var(--bma-text-light);
    display: flex;
    align-items: center;
}

.bma-input-wrap .bma-toggle-pwd svg {
    width: 18px;
    height: 18px;
}

.bma-form-control {
    width: 100%;
    padding: 12px 44px;
    border: 1.5px solid var(--bma-border);
    border-radius: var(--bma-radius);
    font-size: 0.875rem;
    font-family: inherit;
    color: var(--bma-text);
    background: var(--bma-input-bg);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.bma-form-control::placeholder {
    color: var(--bma-text-light);
}

.bma-form-control:focus {
    outline: none;
    border-color: var(--bma-blue);
    box-shadow: 0 0 0 3px rgba(26, 86, 219, 0.12);
}

.bma-forgot-row {
    text-align: right;
    margin: -8px 0 20px;
}

.bma-forgot-row a {
    font-size: 0.8125rem;
    font-weight: 500;
}

.bma-btn-login {
    width: 100%;
    padding: 13px 24px;
    background: var(--bma-green);
    color: var(--bma-white);
    border: none;
    border-radius: var(--bma-radius);
    font-size: 0.9375rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.2s;
}

.bma-btn-login:hover {
    background: var(--bma-green-dark);
}

.bma-btn-login svg {
    width: 18px;
    height: 18px;
}

.bma-help-box {
    margin-top: 28px;
    padding: 16px;
    border: 1px solid var(--bma-border);
    border-radius: var(--bma-radius);
    background: var(--bma-bg-light);
}

.bma-help-box-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.bma-help-box-header svg {
    width: 22px;
    height: 22px;
    color: var(--bma-blue);
    flex-shrink: 0;
}

.bma-help-box-header span {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--bma-navy);
}

.bma-help-box p {
    font-size: 0.75rem;
    color: var(--bma-text-muted);
    margin-bottom: 8px;
}

.bma-help-contacts {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.bma-help-contacts a {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: var(--bma-text-muted);
    text-decoration: none;
}

.bma-help-contacts a:hover {
    color: var(--bma-blue);
}

.bma-help-contacts svg {
    width: 14px;
    height: 14px;
}

.bma-validation-summary {
    background: #FEF2F2;
    border: 1px solid #FECACA;
    color: var(--bma-error);
    padding: 12px 16px;
    border-radius: var(--bma-radius);
    margin-bottom: 20px;
    font-size: 0.8125rem;
    list-style: none;
}

.bma-field-error {
    color: var(--bma-error);
    font-size: 0.75rem;
    margin-top: 4px;
    display: block;
}

/* ── Trust bar ── */
.bma-trust-bar {
    background: var(--bma-white);
    border-radius: var(--bma-radius-lg);
    box-shadow: var(--bma-shadow);
    margin-bottom: 40px;
    padding: 24px 32px;
}

.bma-trust-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.bma-trust-item {
    display: flex;
    align-items: center;
    gap: 14px;
}

.bma-trust-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid var(--bma-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bma-blue);
    flex-shrink: 0;
}

.bma-trust-icon svg {
    width: 20px;
    height: 20px;
}

.bma-trust-item h4 {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--bma-navy);
    margin-bottom: 2px;
}

.bma-trust-item p {
    font-size: 0.6875rem;
    color: var(--bma-text-muted);
}

/* ── Footer ── */
.bma-footer {
    background: var(--bma-footer-bg);
    padding: 48px 0 0;
}

.bma-footer-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 1fr 1.2fr;
    gap: 32px;
    padding-bottom: 36px;
}

.bma-footer-logo img {
    height: 48px;
    margin-bottom: 14px;
}

.bma-footer-about {
    font-size: 0.75rem;
    color: var(--bma-text-muted);
    line-height: 1.6;
    margin-bottom: 16px;
}

.bma-footer-social {
    display: flex;
    gap: 10px;
}

.bma-footer-social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bma-navy);
    color: var(--bma-white);
    transition: background 0.2s;
}

.bma-footer-social a:hover {
    background: var(--bma-blue);
    text-decoration: none;
}

.bma-footer-social svg {
    width: 14px;
    height: 14px;
}

.bma-footer-col h5 {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--bma-navy);
    margin-bottom: 16px;
}

.bma-footer-col ul {
    list-style: none;
}

.bma-footer-col li {
    margin-bottom: 8px;
}

.bma-footer-col a {
    font-size: 0.75rem;
    color: var(--bma-text-muted);
    text-decoration: none;
}

.bma-footer-col a:hover {
    color: var(--bma-blue);
}

.bma-footer-contact li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 0.75rem;
    color: var(--bma-text-muted);
    margin-bottom: 10px;
}

.bma-footer-contact svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    margin-top: 2px;
    color: var(--bma-green);
}

.bma-footer-bottom {
    border-top: 1px solid var(--bma-border);
    padding: 16px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.75rem;
    color: var(--bma-text-muted);
}

.bma-footer-bottom .heart {
    color: var(--bma-error);
}

/* ── Responsive ── */
@media (max-width: 1024px) {
    .bma-nav {
        display: none;
    }

    .bma-login-card {
        grid-template-columns: 1fr;
    }

    .bma-welcome-panel {
        border-right: none;
        border-bottom: 1px solid var(--bma-border);
    }

    .bma-trust-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .bma-footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .bma-topbar-contacts {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .bma-feature-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .bma-trust-grid {
        grid-template-columns: 1fr;
    }

    .bma-footer-grid {
        grid-template-columns: 1fr;
    }

    .bma-welcome-panel,
    .bma-form-panel {
        padding: 28px 20px;
    }
}

/* Role toggle links (Admin/Faculty <-> Candidate) */
a.bma-role-toggle-btn,
span.bma-role-toggle-btn {
    text-align: center;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Circular brand logo */
.bma-logo img,
.bma-footer-logo img {
    border-radius: 50%;
    aspect-ratio: 1 / 1;
    object-fit: contain;
}