/* Modern Auth Modal Styles */

/* New Figma Design Styles - Light Theme */
.modal-logo-wrapper {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    width: 100%;
    position: relative;
}

.modal-logo-img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    position: relative;
    z-index: 0;
    opacity: 1;
}

.modal-brand-text {
    font-family: 'Inria Sans', sans-serif;
    font-size: 40px;
    font-weight: bold;
    background: linear-gradient(97deg, #FFFEFF 5.89%, #D1ABF5 14.17%, #9971B6 41.94%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -1.2px;
    white-space: nowrap;
    position: relative;
    z-index: 1000;
    margin-left: -70px;
    padding-left: 75px;
    isolation: isolate;
}

.modal-subtitle-top {
    font-family: 'Inter', sans-serif;
    font-size: 24px;
    font-weight: normal;
    color: #8B92A3;
    text-align: center;
    margin: 0 0 32px 0;
}

.modal-title-main {
    font-family: 'Inter', sans-serif;
    font-size: 36px;
    font-weight: 600;
    color: #000000;
    text-align: center;
    margin: 0 0 40px 0;
}

.google-login-button-new {
    width: 586px;
    height: 76px;
    background: white;
    border: 1px solid #747775;
    border-radius: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Roboto', sans-serif;
    font-size: 24px;
    font-weight: 300;
    color: #1F1F1F;
    padding: 0 157px;
    margin: 0 auto 32px;
}

.google-login-button-new:hover {
    background: #F8F9FA;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}

.google-login-button-new:active {
    transform: translateY(0);
}

.divider-line {
    width: 574px;
    height: 1px;
    background: #E5E5E5;
    margin: 0 auto 32px;
}

.auth-features-new {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 0 auto 40px;
    width: fit-content;
}

.auth-feature-item {
    display: flex;
    align-items: center;
    gap: 20px;
    font-family: 'Inter', sans-serif;
    font-size: 20px;
    font-weight: 300;
    color: #434343;
    letter-spacing: 0.6px;
}

.check-icon {
    width: 25.5px;
    height: 25.5px;
}

.login-notice-new {
    background: #DBE5FF;
    border: 3px solid #DCDCE1;
    border-radius: 8px;
    padding: 20px;
    width: 586px;
    margin: 0 auto;
    text-align: center;
}

.login-notice-new .notice-text {
    font-family: 'Inter', sans-serif;
    font-size: 20px;
    font-weight: 500;
    color: #6264CE;
    letter-spacing: -1px;
    margin: 0;
}

.modal-close-new,
#modalClose.modal-close-new {
    position: absolute;
    right: 26px;
    top: 26px;
    width: 36px;
    height: 36px;
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
    cursor: pointer;
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s ease;
    border-radius: 0 !important;
    box-shadow: none !important;
}

.modal-close-new:hover,
#modalClose.modal-close-new:hover {
    opacity: 0.7;
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

.modal-close-new:focus,
#modalClose.modal-close-new:focus {
    outline: none;
    background: transparent !important;
}

.modal-close-new .close-icon {
    width: 36px;
    height: 36px;
    pointer-events: none;
}

/* OAuth Container and Button Styles */
.oauth-container {
    padding: 2rem 0;
    text-align: center;
}

/* Step Management */
.auth-step {
    display: none;
    animation: fadeIn 0.3s ease;
    padding: 50px 56px 60px;
}

.auth-step.active {
    display: block;
}

/* Modal Header Section */
.modal-header-section {
    text-align: center;
    margin-bottom: 32px;
    padding: 0;
    position: relative;
    z-index: 1;
}

.modal-title {
    font-size: 28px;
    font-weight: 700;
    color: #171717;
    margin: 0 0 8px 0;
}

.modal-subtitle {
    font-size: 15px;
    color: #737373;
    margin: 0;
}

.modal-icon {
    display: inline-flex;
    margin-bottom: 1rem;
    animation: scaleIn 0.4s ease;
}

.modal-icon.success {
    animation: bounceIn 0.5s ease;
}

@keyframes scaleIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes bounceIn {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }
    50% {
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Login Options */
.login-options {
    margin: 2rem 0;
}

.google-login-button {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 24px;
    background: white;
    border: 1px solid #dadce0;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 500;
    color: #3c4043;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.google-login-button.elevated {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.05);
}

.google-login-button:hover {
    background: #f8f9fa;
    border-color: #171717;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.12), 0 8px 24px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.google-login-button:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08), 0 2px 6px rgba(0, 0, 0, 0.05);
}

.google-login-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.google-icon {
    flex-shrink: 0;
}

/* Divider with Text */
.divider-with-text {
    position: relative;
    text-align: center;
    margin: 1.5rem 0;
}

.divider-with-text::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--border-default);
}

.divider-with-text span {
    position: relative;
    padding: 0 1rem;
    background: var(--bg-card);
    color: var(--text-tertiary);
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Auth Features */
.auth-features {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 24px 0;
}

.auth-feature {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #525252;
}

.auth-feature svg {
    flex-shrink: 0;
}

/* Login Notice */
.login-notice {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 1px solid #bae6fd;
    border-radius: 8px;
    padding: 12px 16px;
    margin-top: 1.5rem;
}

.notice-text {
    font-size: 14px;
    color: #0369a1;
    margin: 0;
    line-height: 1.5;
}

/* Simplified Terms Agreement Styles */
.terms-simple {
    margin: 32px 0;
}

.checkbox-container.essential {
    background: transparent;
    border: none;
    padding: 16px;
    margin-bottom: 8px;
    justify-content: center;
}

.checkbox-container.essential:hover {
    background: #fafafa;
}

.checkbox-container.essential .checkbox-label {
    text-align: center;
}

.terms-links {
    text-align: center;
    margin: 12px 0 20px;
}

.terms-note {
    text-align: center;
    margin-top: 16px;
}

.terms-note p {
    font-size: 13px;
    color: #737373;
    margin: 0;
}

/* Custom Checkbox */
.checkbox-container {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    user-select: none;
    padding: 12px;
    border-radius: 8px;
    transition: background 0.2s ease;
}

.checkbox-container:hover {
    background: var(--bg-hover);
}


.checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.checkmark {
    position: relative;
    height: 20px;
    width: 20px;
    background-color: white;
    border: 2px solid #d1d5db;
    border-radius: 4px;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.checkbox-container input:checked ~ .checkmark {
    background-color: #171717;
    border-color: #171717;
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-container input:checked ~ .checkmark:after {
    display: block;
    animation: checkAnimation 0.2s ease;
}

@keyframes checkAnimation {
    0% {
        transform: rotate(45deg) scale(0);
    }
    100% {
        transform: rotate(45deg) scale(1);
    }
}

.checkbox-label {
    margin-left: 12px;
    font-size: 15px;
    color: #171717;
    line-height: 1.5;
    flex: 1;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
}

.required {
    color: #ef4444;
    font-weight: 600;
    font-size: 13px;
}

.optional {
    color: #6b7280;
    font-weight: 600;
    font-size: 13px;
}

.link-detail {
    color: #3b82f6;
    text-decoration: underline;
    margin-left: 8px;
    font-size: 14px;
    white-space: nowrap;
}

.link-terms {
    color: #3b82f6;
    text-decoration: underline;
    font-size: 14px;
    font-weight: 500;
    display: inline-block;
    padding: 4px 12px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.link-terms:hover {
    color: #2563eb;
    background: #f0f9ff;
}

.link-detail:hover {
    color: #2563eb;
}

/* Terms Actions */
.terms-action {
    margin-top: 32px;
}

.btn-primary.full-width {
    width: 100%;
    padding: 16px 24px;
    font-size: 16px;
    font-weight: 600;
}

/* Modal-specific button styles - Only apply inside modals */
.modal-overlay .btn-secondary,
.modal-overlay .btn-primary {
    flex: 1;
    padding: 14px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.modal-overlay .btn-secondary {
    background: white;
    border: 1px solid var(--border-default);
    color: var(--text-primary);
}

.modal-overlay .btn-secondary:hover {
    background: var(--bg-hover);
}

.modal-overlay .btn-primary {
    background: #171717;
    border: 1px solid #171717;
    color: white;
}

.modal-overlay .btn-primary:hover:not(:disabled) {
    background: #262626;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.modal-overlay .btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Terms Footer */

/* Login Info (legacy) */
.login-info {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e5e7eb;
    text-align: center;
}

.login-info p {
    font-size: 12px;
    color: #6b7280;
    line-height: 1.5;
}

.login-info a {
    color: #3b82f6;
    text-decoration: underline;
}

/* Modal Styles for viewer.html compatibility */
.modal, .modal-overlay {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.8);
}

.modal.active, .modal-overlay.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: #ffffff;
    margin: auto;
    padding: 0;
    border: none;
    width: 698px;
    max-width: calc(100vw - 32px);
    border-radius: 22px;
    box-shadow: 0px 4px 15.8px 0px rgba(0, 0, 0, 0.3);
    max-height: calc(100vh - 64px);
    overflow-y: auto;
    position: relative;
}

.modal-content::-webkit-scrollbar {
    width: 6px;
}

.modal-content::-webkit-scrollbar-track {
    background: transparent;
}

.modal-content::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.modal-header {
    padding: 24px 24px 20px;
    border-bottom: 1px solid var(--border-default);
    position: relative;
}

.modal-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-body {
    padding: 40px;
}

.modal-body p {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

/* Legacy modalClose styles - Disabled for new design */
/*
#modalClose {
    position: absolute;
    right: 24px;
    top: 24px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: var(--text-secondary);
    line-height: 1;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s ease;
}

#modalClose:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}
*/

/* Override for new modal close button */
#modalClose.modal-close-new {
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
}

#modalClose.modal-close-new:hover {
    background: transparent !important;
}

#googleLoginButton {
    width: 100%;
    padding: 14px 24px;
    background: white;
    border: 1px solid #dadce0;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    color: #3c4043;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px 0 rgba(60, 64, 67, 0.1), 0 1px 3px 1px rgba(60, 64, 67, 0.08);
}

#googleLoginButton:hover {
    background: #f8f9fa;
    border-color: #171717;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
    transform: translateY(-1px);
}

/* Loading State */
.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #171717;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error Message */
.form-error {
    display: none;
    padding: 12px;
    background: #fee;
    border: 1px solid #fcc;
    border-radius: 6px;
    color: #c00;
    font-size: 14px;
    margin-top: 12px;
}

.form-error.active {
    display: block;
    animation: shake 0.3s ease;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .modal-content {
        width: 100%;
        max-width: 100%;
        height: 100%;
        max-height: 100vh;
        margin: 0;
        border-radius: 0;
        border: none;
    }

    .google-login-button-new {
        width: calc(100% - 32px);
        padding: 0 40px;
        font-size: 20px;
    }

    .divider-line {
        width: calc(100% - 32px);
    }

    .login-notice-new {
        width: calc(100% - 32px);
    }

    .modal-brand-text {
        font-size: 32px;
    }

    .modal-subtitle-top {
        font-size: 20px;
    }

    .modal-title-main {
        font-size: 28px;
    }

    .auth-feature-item {
        font-size: 16px;
    }
    
    .modal-body {
        padding: 24px;
    }
    
    .auth-step {
        padding: 24px;
    }
    
    .modal-header-section {
        padding: 0 24px;
        margin-bottom: 24px;
    }
    
    .modal-icon {
        transform: scale(0.9);
    }
    
    .modal-title {
        font-size: 24px;
    }
    
    .modal-subtitle {
        font-size: 14px;
    }
    
    .auth-features {
        font-size: 13px;
    }
    
    .terms-container {
        padding: 16px;
        margin: 20px 0;
    }
    
    .checkbox-container {
        padding: 10px;
    }
    
    .checkbox-label {
        font-size: 14px;
    }
    
    .required,
    .optional {
        font-size: 12px;
    }
    
    .link-detail {
        font-size: 13px;
        display: block;
        margin-left: 0;
        margin-top: 4px;
    }
    
    .btn-secondary,
    .btn-primary {
        padding: 14px 20px;
        font-size: 15px;
    }
    
    .terms-footer p {
        font-size: 12px;
    }
    
    #modalClose.modal-close-new {
        right: 16px;
        top: 16px;
    }
}

@media (max-width: 480px) {
    .modal-body {
        padding: 20px;
    }
    
    .auth-step {
        padding: 20px;
    }
    
    .modal-header-section {
        padding: 0 20px;
    }
    
    .google-login-button {
        padding: 14px 20px;
        font-size: 15px;
    }
    
    .terms-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .btn-secondary,
    .btn-primary {
        width: 100%;
    }
}

/* Animation Classes */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

.animate-fadeIn {
    animation: fadeIn 0.3s ease;
}

.animate-slideUp {
    animation: slideUp 0.4s ease;
}