/* Modal Auth System */
.auth-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.auth-modal-overlay.active {
    display: flex;
    opacity: 1;
}

.auth-modal {
    background: white;
    border-radius: 20px;
    width: 90%;
    max-width: 440px;
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: visible;
}

.auth-modal-overlay.active .auth-modal {
    transform: scale(1);
}

.auth-modal-close {
    position: absolute;
    top: -12px;
    right: -12px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    border: 2px solid #e0e0e0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 1001;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.auth-modal-close:hover {
    background: #ff4444;
    border-color: #ff4444;
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 6px 16px rgba(255, 68, 68, 0.4);
}

.auth-modal-close svg {
    width: 18px;
    height: 18px;
    stroke: #666;
    stroke-width: 2.5;
    transition: stroke 0.2s;
}

.auth-modal-close:hover svg {
    stroke: white;
}

/* Shake animation when trying to close during registration */
@keyframes shake {

    0%,
    100% {
        transform: scale(1) translateX(0);
    }

    10%,
    30%,
    50%,
    70%,
    90% {
        transform: scale(1) translateX(-8px);
    }

    20%,
    40%,
    60%,
    80% {
        transform: scale(1) translateX(8px);
    }
}

.auth-modal.shake {
    animation: shake 0.5s ease-in-out;
}

.auth-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #f0f0f0;
    padding: 0 32px;
    margin-bottom: 32px;
}

.auth-tab {
    flex: 1;
    padding: 20px 16px;
    background: none;
    border: none;
    font-size: 15px;
    font-weight: 600;
    color: #999;
    cursor: pointer;
    position: relative;
    transition: color 0.2s;
}

.auth-tab:hover {
    color: #666;
}

.auth-tab.active {
    color: #000;
}

.auth-tab.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: scaleX(0);
    }

    to {
        transform: scaleX(1);
    }
}

.auth-content {
    padding: 0 32px 32px;
    max-height: calc(90vh - 150px);
    overflow-y: auto;
}

.auth-panel {
    display: none;
}

.auth-panel.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-title {
    font-size: 24px;
    font-weight: 700;
    color: #000;
    margin-bottom: 8px;
}

.auth-subtitle {
    font-size: 14px;
    color: #666;
    margin-bottom: 24px;
}

.auth-button-google {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 14px 20px;
    background: white;
    border: 1.5px solid #e0e0e0;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    color: #333;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.auth-button-google:hover {
    background: #fafafa;
    border-color: #d0d0d0;
    transform: translateY(-1px);
}

.auth-button-google img {
    width: 20px;
    height: 20px;
}

.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 24px 0;
    color: #999;
    font-size: 13px;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #e0e0e0;
}

.auth-divider span {
    padding: 0 16px;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.auth-input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.auth-input {
    width: 100%;
    padding: 14px 16px;
    border: 1.5px solid #e0e0e0;
    border-radius: 12px;
    font-size: 15px;
    font-family: 'Inter', sans-serif;
    transition: all 0.2s;
    background: white;
}

.auth-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.auth-input::placeholder {
    color: #999;
}

.auth-submit {
    width: 100%;
    padding: 14px 20px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 8px;
}

.auth-submit:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.auth-submit:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.auth-links {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
    font-size: 14px;
    text-align: center;
}

.auth-links a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.auth-links a:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

.auth-message {
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 14px;
    margin-bottom: 16px;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-message.error {
    background: #fee;
    border: 1px solid #fcc;
    color: #c00;
}

.auth-message.success {
    background: #dbeafe;
    border: 1px solid var(--accent);
    color: #1e40af;
}

.auth-message.info {
    background: #fff3cd;
    border: 1px solid #ffe69c;
    color: #856404;
}

/* Document validation styles */
.doc-input-row {
    display: flex;
    gap: 8px;
}

.doc-type-select {
    width: 110px;
    padding: 14px 12px;
    border: 1.5px solid #e0e0e0;
    border-radius: 12px;
    font-size: 15px;
    font-family: 'Inter', sans-serif;
    background: white;
    cursor: pointer;
}

.doc-type-select:focus {
    outline: none;
    border-color: var(--accent);
}

.doc-input-wrapper {
    flex: 1;
    display: flex;
    gap: 8px;
}

.btn-validate {
    padding: 14px 20px;
    background: #f5f5f5;
    color: #333;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-validate:hover {
    background: #e0e0e0;
}

.btn-validate:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.doc-status {
    font-size: 13px;
    padding: 8px 0;
    margin-top: -8px;
}

.doc-status.success {
    color: #10b981;
}

.doc-status.error {
    color: #ef4444;
}

@media (max-width: 480px) {
    .auth-modal {
        width: 95%;
        max-width: 100%;
        border-radius: 16px;
    }

    .auth-tabs,
    .auth-content {
        padding-left: 24px;
        padding-right: 24px;
    }

    .auth-tab {
        padding: 16px 12px;
        font-size: 14px;
    }

    .auth-title {
        font-size: 20px;
    }

    .doc-input-row {
        flex-direction: column;
    }

    .doc-type-select {
        width: 100%;
    }
}