@font-face {
    font-family: 'Framework-Sans';
    src: url('../fonts/FrameworkSans-Bold.ttf');
    font-weight: 600;
}

@font-face {
    font-family: 'Framework-Sans';
    src: url('../fonts/FrameworkSans-Medium.ttf');
    font-weight: 500;
}

@font-face {
    font-family: 'Framework-Sans';
    src: url('../fonts/FrameworkSans-Regular.ttf');
    font-weight: 400;
}

@font-face {
    font-family: 'Framework-Sans';
    src: url('../fonts/FrameworkSans-Light.ttf');
    font-weight: 300;
}

@font-face {
    font-family: 'Framework-Sans-CAPS';
    src: url('../fonts/FrameworkSans-Caps-Bold.ttf');
    font-weight: 600;
}

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

body {
    font-family: Framework-Sans, sans-serif;
    background-color: #FFFFFF;
    color: #272733;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

button, input, textarea, select, option {
    font-family: Framework-Sans, sans-serif;
}

.container {
    max-width: 320px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

/* Logo text with badge */
.logo-text {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 20px;
    font-weight: 600;
    user-select: none;
}

.logo-text svg {
    height: 30px;
}

.logo-text .framework {
    font-weight: 600;
}

.logo-text .id-badge {
    background-color: #272733;
    color: #FFFFFF;
    border-radius: 13px;
    font-weight: 600;
    font-size: 19px;
    display: inline-block;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 32px;
    width: 32px;
}

/* Main heading */
.main-heading {
    font-size: 20px;
    font-weight: 500;
    text-align: center;
    width: 100%;
    font-family: Framework-Sans-CAPS, sans-serif;
}

/* Tabs as pill segmented control */
.login-tabs {
    display: flex;
    width: 100%;
    background-color: #fff;
    border-radius: 21px;
    overflow: hidden;
    border: 1px solid #d8dce6;
    padding: 2.4px;
}

.tab {
    flex: 1;
    padding: 12px 0;
    font-size: 15px;
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    background-color: transparent;
    border: none;
    color: #999999;
    user-select: none;
    font-family: Framework-Sans, sans-serif;
}

.tab.active {
    background-color: #f1f2f5;
    color: #272733;
    border-radius: 18px;
}

/* Input field pill style */
.input-container {
    width: 100%;
}

.input-field {
    width: 100%;
    padding: 14px 20px;
    font-size: 16px;
    border-radius: 22px;
    border: 1px solid #d8dce6;
    outline: none;
    transition: border-color 0.2s ease;
    background-color: #fff;
    color: #272733;
}

.input-field::placeholder {
    color: #999999;
}

.input-field:focus {
    border-color: #272733;
}

.input-field.error {
    border-color: #dc3545;
    background-color: #fff5f5;
}

.input-field.error:focus {
    border-color: #dc3545;
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.2);
}

/* Buttons */
.btn-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn {
    width: 100%;
    padding: 16px 20px;
    font-size: 15px;
    font-weight: 500;
    border-radius: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    user-select: none;
    transition: background-color 0.2s ease, border-color 0.2s ease;
    font-family: Framework-Sans, sans-serif;
    text-decoration: none;
    color: inherit;
}

.btn-primary {
    background-color: #292933;
    color: #FFFFFF;
    border: none;
}

.btn-primary:hover {
    background-color: #1b1b26;
}

.btn-secondary {
    background-color: rgba(180,184,204,.2);
    color: #191919;
    border: none;
}

.btn-secondary:hover {
    background-color: rgba(180,184,204,.25);
}

.btn-outline {
    background-color: #FFFFFF;
    border: 1px solid #d8dce6;
}

.btn-outline:hover {
    background-color: #F9F9F9;
}

/* Fingerprint icon */
.fingerprint-icon {
    width: 20px;
    height: 20px;
    display: inline-block;
    position: relative;
    border-radius: 50%;
    box-sizing: content-box;
    border: 2px solid #666666;
}

.fingerprint-icon::before {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    right: 3px;
    bottom: 3px;
    border: 2px solid #666666;
    border-radius: 50%;
    box-sizing: content-box;
}

.fingerprint-icon::after {
    content: '';
    position: absolute;
    top: 7px;
    left: 7px;
    right: 7px;
    bottom: 7px;
    border: 2px solid #666666;
    border-radius: 50%;
    box-sizing: content-box;
}



/* Form containers */
.form-container {
    width: 100%;
    transition: transform 0.3s ease, opacity 0.3s ease;
    transform: translateX(0);
    opacity: 1;
}

/* Login tabs animation */
.login-tabs {
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Main heading animation */
.main-heading {
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Form spacing */
.login-form .input-container {
    margin-bottom: 24px;
}

.create-form .input-container {
    margin-bottom: 16px;
}

.create-form .input-container:last-of-type {
    margin-bottom: 0;
}

/* Enhanced button styles for create form */
.btn-secondary {
    background-color: rgba(180,184,204,.2);
    color: #191919;
    border: none;
}

.btn-secondary:hover {
    background-color: rgba(180,184,204,.25);
}

/* Smooth transitions for all interactive elements */
.input-field, .btn, .tab {
    transition: all 0.2s ease;
}

/* Login step styles */
.login-step {
    width: 100%;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.login-step.hidden {
    transform: translateX(-100%);
    opacity: 0;
}

.login-step.visible {
    transform: translateX(0);
    opacity: 1;
}

/* Register step styles */
.register-step {
    width: 100%;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.register-step.hidden {
    transform: translateX(-100%);
    opacity: 0;
}

.register-step.visible {
    transform: translateX(0);
    opacity: 1;
}

/* User welcome message */
.user-welcome {
    text-align: center;
    margin-bottom: 20px;
    padding: 16px;
    background-color: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #e9ecef;
}

.user-welcome p {
    margin: 0;
    font-size: 16px;
    color: #272733;
    font-weight: 500;
}

.user-welcome span {
    font-weight: 600;
    color: #272733;
}

/* Login avatar styles */
.login-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #e9ecef;
    margin: 0 auto 16px auto;
    display: block;
}

.login-avatar-placeholder {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 32px;
    font-weight: 600;
    margin: 0 auto 16px auto;
    border: 3px solid #e9ecef;
}

/* Error message styles */
.error-message {
    margin-top: 6px;
    font-size: 12px;
    color: #dc3545;
    font-weight: 500;
    display: none;
    line-height: 1.4;
    margin-left: 6px;
}

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

/* Message styles */
.message {
    margin-top: 16px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    display: none;
}

.message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.message.show {
    display: block;
}

/* Footer */
.footer {
    text-align: center;
    font-size: 14px;
    color: #999999;
    user-select: none;
    width: 100%;
}

.footer-link {
    color: #999999;
    text-decoration: none;
    font-weight: 500;
    margin-top: 6px;
    display: inline-block;
    cursor: pointer;
    user-select: none;
    transition: text-decoration 0.2s ease;
}

.footer-link:hover {
    text-decoration: underline;
}

/* Success message styles */
.success-message {
    text-align: center;
    padding: 24px 16px;
    /* background-color: #f8f9fa; */
    /* border-radius: 16px; */
    /* border: 1px solid #e9ecef; */
    margin-bottom: 24px;
}

.success-icon {
    width: 60px;
    height: 60px;
    background-color: #292933;
    stroke: white;
    
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    margin: 0 auto 16px auto;
}

.success-icon svg {
    color: #fff;
    height: 36px;
    width: 36px;
}


.success-message h2 {
    font-size: 18px;
    font-weight: 600;
    color: #272733;
    margin-bottom: 12px;
    font-family: Framework-Sans-CAPS, sans-serif;
}

.success-message p {
    font-size: 14px;
    color: #666666;
    line-height: 1.5;
    margin-bottom: 8px;
}

.success-message p:last-of-type {
    margin-bottom: 0;
}

.email-display {
    font-weight: 600;
    color: #272733 !important;
    background-color: #e9ecef;
    padding: 8px 12px;
    border-radius: 8px;
    display: inline-block;
    margin-top: 12px !important;
}


/* Loading button state */
.btn.loading {
    position: relative;
    color: transparent;
}

.btn.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

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

/* Unified Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: modalFadeIn 0.3s ease-out;
}

.modal-content {
    background-color: #ffffff;
    border-radius: 26px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    animation: modalSlideIn 0.3s ease-out;
}

/* Mobile full-screen modals with iOS-style animation */
@media (max-width: 768px) {
    .modal-content {
        width: 100%;
        height: calc(100vh - 20px);
        max-width: none;
        max-height: none;
        border-radius: 30px 30px 0 0;
        margin: 20px 0 0 0;
        display: flex;
        flex-direction: column;
        animation: modalSlideUp 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
        transform: translateY(0);
    }
    
    .modal-overlay {
        align-items: flex-end;
        justify-content: stretch;
        animation: modalFadeIn 0.3s ease-out;
    }
}

/* iOS-style slide up animation for mobile */
@keyframes modalSlideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px 0 24px;
    margin-bottom: 14px;
}

.modal-header h3 {
    font-size: 18px;
    color: #272733;
    margin: 0;
    font-weight: 600;
    font-family: Framework-Sans-CAPS, sans-serif;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
    width: 36px;
    height: 36px;
}

.modal-close:hover {
    background-color: #f5f5f5;
    color: #272733;
}

.modal-body {
    padding: 0 20px 20px 20px;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
    flex-wrap: wrap;
}

/* Modal Animations */
@keyframes modalFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

/* Legacy modal support for backward compatibility */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.close {
    color: #999999;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s ease;
}

.close:hover {
    color: #272733;
}

.modal-body p {
    margin: 0 0 16px 0;
    font-size: 14px;
    color: #666666;
}

.modal-body p:last-child {
    margin-bottom: 0;
}

.modal-body a {
    color: #1D4ED8;
    text-decoration: none;
    font-weight: 600;
}

.modal-body a:hover {
    text-decoration: underline;
}

.modal-body strong {
    color: #272733;
    font-weight: 600;
}

/* University Contact Message Styles */
.university-contact-message {
    width: 100%;
    animation: fadeInUp 0.3s ease;
}

.contact-info {
    text-align: center;
}

.contact-icon {
    margin-bottom: 20px;
    color: #6c757d;
}

.contact-icon svg {
    width: 48px;
    height: 48px;
}

.contact-info h2 {
    font-size: 18px;
    font-weight: 600;
    color: #272733;
    margin-bottom: 16px;
    font-family: Framework-Sans-CAPS, sans-serif;
}

.contact-info p {
    font-size: 14px;
    color: #666666;
    line-height: 1.5;
    margin-bottom: 20px;
}

.contact-email {
    margin: 24px 0;
    padding: 16px;
    background-color: #ffffff;
    border-radius: 12px;
    border: 1px solid #d8dce6;
}

.email-link {
    font-size: 16px;
    font-weight: 600;
    color: #1D4ED8;
    text-decoration: none;
    display: inline-block;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.email-link:hover {
    background-color: #f0f4ff;
    text-decoration: none;
}

.contact-note {
    font-size: 13px;
    color: #999999;
    font-style: italic;
    margin-top: 16px;
}

/* Animation for university message */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}