/* Scoped styles for Auth Layout */

/* Use a wrapper class to isolate auth styles */
.auth-page-wrapper {
    --thm-primary: #073163;
    --thm-base: #073163;
    --thm-gray: #6c757d;
    --thm-light: #f8f9fa;
    --thm-border: #e9ecef;
    --thm-white: #ffffff;
    --thm-shadow: 0 20px 60px rgba(0, 0, 0, 0.05);
    --thm-focus-shadow: 0 0 0 4px rgba(7, 49, 99, 0.08);
    
    background: #f0f4f8;
    min-height: calc(100vh - 110px);
    display: flex;
    flex-direction: column;
    font-family: "Nunito", "Segoe UI", Roboto, sans-serif;
    padding: 60px 0;
}

/* Card Container */
.auth-page-wrapper .auth-card {
    background: var(--thm-white);
    border-radius: 24px;
    box-shadow: var(--thm-shadow);
    padding: 60px;
    border: 1px solid rgba(255, 255, 255, 0.6);
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease;
}

/* Subtle Top Border */
.auth-page-wrapper .auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background: var(--thm-base);
}

/* Strip underline from all inline links in auth pages */
.auth-page-wrapper a,
.auth-page-wrapper a:hover,
.auth-page-wrapper a:focus {
    text-decoration: none;
}

/* Back Button */
.auth-page-wrapper .back-btn-wrapper {
    margin-bottom: 40px;
}

.auth-page-wrapper .back-btn {
    display: inline-flex;
    align-items: center;
    background: #fff;
    padding: 10px 20px;
    border-radius: 30px;
    color: var(--thm-gray);
    font-weight: 700;
    font-size: 0.9rem;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    border: 1px solid rgba(0,0,0,0.02);
    transition: all 0.3s ease;
}

.auth-page-wrapper .back-btn:hover {
    color: var(--thm-white);
    background-color: var(--thm-primary);
    transform: translateX(-4px);
    box-shadow: 0 6px 20px rgba(7, 49, 99, 0.15);
}

.auth-page-wrapper .back-btn i {
    margin-right: 8px;
}

/* Header Typography */
.auth-page-wrapper .auth-header {
    margin-bottom: 60px;
    text-align: center;
}

.auth-page-wrapper .auth-header h4 {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--thm-primary);
    margin-bottom: 15px;
    letter-spacing: -0.5px;
}

.auth-page-wrapper .auth-header p {
    font-size: 1.15rem;
    color: var(--thm-gray);
    max-width: 600px;
    margin: 0 auto;
}

/* Form Sections */
.auth-page-wrapper .form-section {
    margin-bottom: 50px;
    padding: 10px 0;
}

.auth-page-wrapper .section-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--thm-primary);
    margin-bottom: 35px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--thm-border);
    position: relative;
}

.auth-page-wrapper .section-title::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 80px;
    height: 2px;
    background: var(--thm-base);
    border-radius: 2px;
}

/* Inputs - Scoped to auth-page-wrapper */
.auth-page-wrapper .form-control,
.auth-page-wrapper .form-select {
    height: 58px;
    background-color: #fff;
    border: 1px solid #d1d9e6;
    border-radius: 14px;
    padding: 0 20px;
    font-size: 1rem;
    color: var(--thm-primary);
    transition: all 0.25s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.01);
}

.auth-page-wrapper .form-control::placeholder {
    color: #aab2bd;
}

.auth-page-wrapper .form-control:focus,
.auth-page-wrapper .form-select:focus {
    background-color: #fff;
    border-color: var(--thm-base);
    box-shadow: var(--thm-focus-shadow);
    outline: none;
    transform: translateY(-1px);
}

.auth-page-wrapper .form-label {
    color: var(--thm-primary);
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 10px;
    display: inline-block;
    letter-spacing: 0.3px;
}

/* File Inputs */
.auth-page-wrapper input[type="file"] {
    padding: 12px;
    height: auto;
    background-color: var(--thm-light);
}

.auth-page-wrapper input[type="file"]::file-selector-button {
    margin-right: 20px;
    border: none;
    background: var(--thm-primary);
    color: #fff;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    transition: background 0.3s;
}

.auth-page-wrapper input[type="file"]::file-selector-button:hover {
    background: var(--thm-base);
}

/* Signature Canvas */
.auth-page-wrapper .signature-pad-wrapper {
    background-color: var(--thm-light);
    border: 2px dashed #cbd5e0;
    border-radius: 20px;
    padding: 30px;
    transition: all 0.3s;
}

.auth-page-wrapper .signature-pad-wrapper:hover {
    border-color: var(--thm-base);
    background-color: #fff;
}

.auth-page-wrapper .signature-canvas {
    width: 100%;
    height: 400px;
    background: #fff;
    border-radius: 16px;
    cursor: crosshair;
    border: 1px solid #e2e8f0;
    box-shadow: 0 5px 15px rgba(0,0,0,0.03);
}

/* Declaration Box */
.auth-page-wrapper .declaration-box {
    background-color: var(--thm-light);
    border: 1px solid var(--thm-border);
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 30px;
}

.auth-page-wrapper .form-check-input {
    width: 1.25em;
    height: 1.25em;
    margin-top: 0.25em;
    border: 2px solid #adb5bd;
    cursor: pointer;
}

.auth-page-wrapper .form-check-input:checked {
    background-color: var(--thm-base);
    border-color: var(--thm-base);
}

.auth-page-wrapper .form-check-label {
    font-size: 1rem;
    line-height: 1.5;
    color: var(--thm-primary);
    cursor: pointer;
}

/* Submit Button */
.auth-page-wrapper .thm-btn {
    width: 100%;
    border-radius: 14px;
    padding: 20px;
    font-size: 1.1rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 20px;
    border: none;
    background: var(--thm-base);
    color: #fff;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 25px rgba(7, 49, 99, 0.25);
}

.auth-page-wrapper .thm-btn:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(7, 49, 99, 0.35);
}

.auth-page-wrapper .thm-btn:disabled {
    opacity: 0.7;
    cursor: default;
    box-shadow: none;
}



/* Validation */
.auth-page-wrapper .custom-validation-summary {
    background-color: #fff5f5;
    color: #e53e3e;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #fed7d7;
    margin-bottom: 30px;
}

.auth-page-wrapper .validation-message {
    color: #e53e3e;
    font-size: 0.85rem;
    margin-top: 5px;
    font-weight: 600;
}

/* Signature Component Additions */
.auth-page-wrapper .signature-label {
    font-weight: 700;
    color: var(--thm-primary);
    margin-bottom: 15px;
    display: block;
    text-align: left;
    font-size: 0.95rem;
}

.auth-page-wrapper .undo-btn {
    border-radius: 20px;
    padding: 8px 20px;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.2s;
    border: 1px solid #fab1b1;
    color: #e53e3e;
    background: transparent;
}

.auth-page-wrapper .undo-btn:hover {
    background-color: #fff5f5;
    color: #c53030;
    border-color: #fc8181;
}

/* Success Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.3s ease;
}

.modal-dialog-custom {
    background: #fff;
    border-radius: 24px;
    padding: 50px 40px;
    max-width: 480px;
    width: 90%;
    text-align: center;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.15);
    animation: slideUp 0.4s ease;
}

.modal-icon-wrapper {
    margin-bottom: 20px;
}

.modal-icon-wrapper i {
    font-size: 4.5rem;
    color: #38a169;
}

.modal-dialog-custom h4 {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--thm-primary);
    margin-bottom: 15px;
}

.modal-dialog-custom p {
    font-size: 0.95rem;
    color: var(--thm-gray);
    line-height: 1.6;
    margin-bottom: 8px;
}

.modal-email {
    font-weight: 700;
    color: var(--thm-base) !important;
    font-size: 1.05rem !important;
}

.modal-note {
    font-size: 0.85rem !important;
    font-style: italic;
    margin-top: 10px;
}

.modal-btn {
    margin-top: 25px;
    max-width: 200px;
    padding: 14px 40px !important;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

/* =============================================
   Submission Loading Overlay
   ============================================= */
.submission-overlay {
    position: fixed;
    inset: 0;
    background: rgba(5, 18, 40, 0.75);
    backdrop-filter: blur(14px) saturate(180%);
    -webkit-backdrop-filter: blur(14px) saturate(180%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: overlayIn 0.35s ease;
}

@keyframes overlayIn {
    from { opacity: 0; backdrop-filter: blur(0px); }
    to   { opacity: 1; backdrop-filter: blur(14px); }
}

.submission-card {
    background: rgba(255, 255, 255, 0.97);
    border-radius: 32px;
    padding: 52px 44px 46px;
    max-width: 460px;
    width: 92%;
    text-align: center;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.28), 0 0 0 1px rgba(255,255,255,0.15);
    animation: cardPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
}

/* Decorative animated top stripe */
.submission-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: #073163;
    animation: stripeSlide 2.4s ease-in-out infinite;
    transform-origin: left;
}

@keyframes stripeSlide {
    0%   { transform: scaleX(0.05); opacity: 0.5; }
    50%  { transform: scaleX(1);    opacity: 1; }
    100% { transform: scaleX(0.05); opacity: 0.5; }
}

@keyframes cardPop {
    from { opacity: 0; transform: scale(0.88) translateY(20px); }
    to   { opacity: 1; transform: scale(1)    translateY(0); }
}

/* ── Orbital spinner ── */
.orbital-spinner {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto 32px;
}

.orbital-spinner .orbit {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 3px solid transparent;
    animation: orbitSpin linear infinite;
}

.orbital-spinner .orbit-1 {
    border-top-color: #073163;
    animation-duration: 1.1s;
}

.orbital-spinner .orbit-2 {
    inset: 10px;
    border-right-color: #073163;
    animation-duration: 0.75s;
    animation-direction: reverse;
}

.orbital-spinner .orbit-3 {
    inset: 22px;
    border-bottom-color: #d4a843;
    animation-duration: 1.6s;
}

.orbital-spinner .orbit-core {
    position: absolute;
    inset: 33px;
    border-radius: 50%;
    background: #073163;
    animation: corePulse 1.4s ease-in-out infinite;
}

@keyframes orbitSpin {
    to { transform: rotate(360deg); }
}

@keyframes corePulse {
    0%, 100% { transform: scale(1);    opacity: 1; }
    50%       { transform: scale(1.35); opacity: 0.7; }
}

/* ── Headline ── */
.submission-card .sc-title {
    font-size: 1.4rem;
    font-weight: 800;
    color: #073163;
    margin-bottom: 6px;
    letter-spacing: -0.4px;
}

.submission-card .sc-subtitle {
    font-size: 0.88rem;
    color: #8e9bb0;
    margin-bottom: 36px;
    line-height: 1.5;
}

/* ── Progress track ── */
.progress-track {
    display: flex;
    flex-direction: column;
    gap: 0;
    text-align: left;
}

.progress-step {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    position: relative;
}

/* Connector line between steps */
.progress-step:not(:last-child)::after {
    content: '';
    position: absolute;
    left: 17px;
    top: 36px;
    bottom: -4px;
    width: 2px;
    background: #e8edf5;
    transition: background 0.5s ease;
}

.progress-step.step-done:not(:last-child)::after {
    background: #38a169;
}

.ps-icon-wrap {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    flex-shrink: 0;
    background: #f0f4f8;
    color: #b0bec8;
    border: 2px solid #e0e8f0;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    margin-top: 2px;
    position: relative;
    z-index: 1;
}

.progress-step.step-active .ps-icon-wrap {
    background: #e8eef7;
    color: #073163;
    border-color: #073163;
    box-shadow: 0 0 0 5px rgba(7, 49, 99, 0.12);
    animation: iconBreathe 1.5s ease-in-out infinite;
}

.progress-step.step-done .ps-icon-wrap {
    background: #d4edda;
    color: #38a169;
    border-color: #38a169;
    box-shadow: none;
}

@keyframes iconBreathe {
    0%, 100% { box-shadow: 0 0 0 4px rgba(7,49,99,0.10); }
    50%       { box-shadow: 0 0 0 8px rgba(7,49,99,0.18); }
}

.ps-text {
    padding: 6px 0 20px;
}

.ps-label {
    font-size: 0.88rem;
    font-weight: 700;
    color: #c0cad8;
    transition: color 0.4s ease;
    line-height: 1.3;
}

.progress-step.step-active .ps-label {
    color: #073163;
}

.progress-step.step-done .ps-label {
    color: #2d7a4f;
}

.ps-sub {
    font-size: 0.76rem;
    color: #c8d3de;
    margin-top: 2px;
    font-weight: 500;
    transition: color 0.4s ease;
    display: none;
}

.progress-step.step-active .ps-sub,
.progress-step.step-done .ps-sub {
    display: block;
}

.progress-step.step-active .ps-sub {
    color: #4a7199;
}

.progress-step.step-done .ps-sub {
    color: #74c69d;
}

/* Mobile Responsiveness */
@media (max-width: 992px) {
    .auth-page-wrapper .auth-card {
        padding: 40px;
    }
    
    .auth-page-wrapper .auth-header h4 {
        font-size: 2rem;
    }
}

@media (max-width: 768px) {
    .auth-page-wrapper {
        padding: 20px 0;
    }
    
    .auth-page-wrapper .auth-card {
        padding: 30px 20px;
        border-radius: 20px;
    }
    
    .auth-page-wrapper .auth-header h4 {
        font-size: 1.75rem;
    }
    
    .auth-page-wrapper .form-control, 
    .auth-page-wrapper .form-select {
        height: 52px;
    }
    
    .auth-page-wrapper .signature-canvas {
        height: 300px;
    }
    
    .auth-page-wrapper .thm-btn {
        padding: 16px;
        font-size: 1rem;
    }
    
    .auth-page-wrapper .back-btn-wrapper {
        margin-bottom: 20px;
        text-align: center;
    }
}
