*{margin:0;padding:0;box-sizing:border-box}
html,body{height:100%;}
body{
  font-family:-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background:#f5f7fb; color:#111;
}
.screen{
  width:100%; max-width:520px; margin:0 auto;
  min-height:100vh; min-height:100dvh;
  display:flex; flex-direction:column;
  padding:20px 16px 90px;
  background:#fff;
}
.top{
  display:flex; align-items:center; justify-content:center;
  padding-bottom:12px; flex-shrink:0;
  text-align:center;
  justify-content:center;
}
.top img{
  height:48px; width:auto;
  display:block;
  margin:0 auto;
}
.content-wrapper{ flex:1; overflow-y:auto; overflow-x:hidden; -webkit-overflow-scrolling:touch; }
.title{ font-size:22px; font-weight:600; text-align:center; margin-top:8px; }
.subtitle{ font-size:14px; color:#666; margin-top:6px; text-align:center; }
.form-section{ margin-top:16px; }
.label{ font-size:13px; color:#666; margin-bottom:8px; display:block; font-weight:500; }
.input-wrap{ position:relative; margin-bottom:16px; }
@media (max-width:639px){
  .input{
    width:100%;
    padding:12px 8px;
    border:none;
    border-bottom:1.5px solid #ccc;
    border-radius:0;
    font-size:16px;
    outline:none;
    background:#fff;
    transition:border-color .2s;
  }
  .input:focus{
    border-color:#17a2b8;
    box-shadow:none;
  }
}
@media (min-width:640px){
  .input{
    width:100%; padding:13px 12px; border:1.5px solid #e3e3e3; border-radius:10px;
    font-size:16px; outline:none; background:#fff; transition:.2s;
  }
  .input:focus{ border-color:#17a2b8; box-shadow:0 0 0 3px rgba(23,162,184,.1); }
}
.code-grid{ display:grid; grid-template-columns:repeat(6, 1fr); gap:8px; margin-top:4px; }
.code-box{
  width:100%; aspect-ratio:1/1; border:1.5px solid #e3e3e3; border-radius:10px;
  text-align:center; font-size:20px; font-weight:700; outline:none; background:#fff;
  transition:border-color .15s, box-shadow .15s;
}
.code-box:focus{ border-color:#17a2b8; box-shadow:0 0 0 3px rgba(23,162,184,.12); }
.choice-grid{ display:grid; grid-template-columns:1fr 1fr; gap:12px; margin-top:12px; }
.choice{
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:10px;
  padding:20px 16px; border:1.5px solid #e3e3e3; border-radius:12px; background:#fafafa; cursor:pointer; font-weight:600;
  transition:transform .15s, box-shadow .15s, border-color .15s;
}
.choice:hover{ transform:translateY(-2px); box-shadow:0 6px 16px rgba(0,0,0,.06); border-color:#d8d8d8; }
.choice svg{ width:32px; height:32px; stroke:#17a2b8; stroke-width:2; fill:none; flex-shrink:0; }
.choice .label{ font-size:14px; color:#111; margin:0; font-weight:600; }
.toggle-visibility{
  position:absolute; right:10px; top:50%; transform:translateY(-50%);
  background:transparent; border:none; cursor:pointer; padding:8px; border-radius:8px;
}
.toggle-visibility:hover{ background:#f5f5f5; }
.eye{ width:20px; height:20px; stroke:#17a2b8; stroke-width:2; fill:none; }
.step{ display:none; }
.step.active{ display:block; }
.bottom-bar{
  position:fixed; left:0; right:0; bottom:0; background:#fff; 
  border-top:1px solid #eee; z-index:100;
  padding:12px 16px; padding-bottom:calc(12px + env(safe-area-inset-bottom));
  display:flex; gap:10px; align-items:center;
}
.btn{ 
  flex:1; display:inline-flex; align-items:center; justify-content:center; 
  padding:14px 20px; border-radius:12px; border:1.5px solid transparent; 
  font-weight:600; font-size:15px; cursor:pointer; transition:.2s;
}
.btn:disabled{ opacity:.5; cursor:not-allowed; }
.btn.primary{ background:linear-gradient(135deg,#17a2b8,#5bc0de); color:#fff; border:none; }
.btn.primary:hover:not(:disabled){ transform:translateY(-1px); box-shadow:0 4px 12px rgba(23,162,184,.3); }
.btn.secondary{ background:#f7f7f7; color:#333; border-color:#e3e3e3; }
.btn.secondary:hover:not(:disabled){ background:#ececec; }
.helper{font-size:13px;color:#666;margin-top:12px;line-height:1.5}
.link{color:#17a2b8;text-decoration:none;font-weight:600}
.link:hover{text-decoration:underline}
.resend-link{
  display:inline-block; margin-top:12px; font-size:13px; color:#17a2b8; 
  cursor:pointer; text-decoration:none; font-weight:600;
}
.resend-link:hover{ text-decoration:underline; }
.school-info{
  background:#e7f9fc; border-left:4px solid #17a2b8; padding:12px 16px; 
  border-radius:8px; margin-top:12px;
}
.school-info .name{ font-weight:600; color:#17a2b8; margin-bottom:4px; }
.school-info .details{ font-size:13px; color:#555; }
@media (min-width:640px){
  body{ display:flex; align-items:center; justify-content:center; padding:20px; }
  .screen{
    min-height:auto; border:1px solid #e0e0e0; border-radius:16px;
    box-shadow:0 8px 24px rgba(0,0,0,.08); padding:32px; padding-bottom:32px;
  }
  .top{ padding-bottom:8px; }
  .top img{ height:56px; }
  .title{ font-size:24px; }
  .subtitle{ font-size:15px; }
  .code-box{ font-size:22px; }
  .choice{ padding:24px 20px; }
  .choice svg{ width:36px; height:36px; }
  .choice .label{ font-size:15px; }
  .bottom-bar{ 
    position:static; border-top:none; padding:0; margin-top:24px; z-index:auto;
  }
}
@media (max-width:340px){
  .code-grid{ grid-template-columns:repeat(3, 1fr); gap:6px; }
  .code-box{ font-size:18px; }
  .choice{ padding:16px 12px; }
  .choice svg{ width:28px; height:28px; }
  .choice .label{ font-size:13px; }
}
@media (max-height:640px){
  .screen{ padding-top:16px; padding-bottom:80px; }
  .title{ font-size:20px; margin-top:4px; }
  .subtitle{ font-size:13px; margin-top:4px; }
  .form-section{ margin-top:12px; }
  .choice-grid{ margin-top:8px; gap:8px; }
  .choice{ padding:16px 12px; gap:8px; }
  .choice svg{ width:28px; height:28px; }
}
.google-btn-wrapper {
  display: flex;
  justify-content: center;
  margin: 24px 0;
}
.custom-google-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  max-width: 400px;
  padding: 14px 24px;
  background: white;
  border: 2px solid #e8eaed;
  border-radius: 12px;
  font-family: 'Google Sans', Roboto, Arial, sans-serif;
  font-size: 16px;
  font-weight: 500;
  color: #3c4043;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}
.custom-google-btn:hover:not(:disabled) {
  background: #f8f9fa;
  border-color: #dadce0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transform: translateY(-1px);
}
.custom-google-btn:active:not(:disabled) {
  background: #f1f3f4;
  transform: translateY(0);
}
.custom-google-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.google-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}
      .oauth-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: white;
  color: black;
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  animation: fadeIn 0.3s ease-in-out;
}
.oauth-overlay.active {
  display: flex;
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.oauth-content {
  text-align: center;
  color: white;
  padding: 40px;
  max-width: 500px;
}
.oauth-spinner {
  width: 80px;
  height: 80px;
  margin: 0 auto 30px;
  border: #17a2b8;
  border-top: 6px solid #17a2b8;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
.oauth-title {
  font-size: 28px;
  font-weight: 600;
  margin-bottom: 16px;
color:#17a2b8 ;
}
.oauth-message {
  font-size: 16px;
  line-height: 1.6;
  opacity: 0.95;
  margin-bottom: 24px;
  color: black;
}
.oauth-steps {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 20px;
  backdrop-filter: blur(10px);
  color: black;
  font-size: 14px;
  line-height: 1.8;
  text-align: left;
}
.oauth-step {
  display: flex;
  align-items: center;
  color: black;
  margin: 8px 0;
}
.oauth-step-icon {
  width: 24px;
  height: 24px;
 border: 1px solid #17a2b8;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 12px;
  font-size: 12px;
}
.oauth-step.active .oauth-step-icon {
  background: white;
  color: white;
  background-color: #17a2b8;
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}
@media (max-width: 480px) {
  .custom-google-btn {
      font-size: 15px;
      padding: 12px 20px;
  }
  .oauth-title {
      font-size: 24px;
  }
  .oauth-message {
      font-size: 15px;
  }
}
.school-search-results {
    margin-top: 12px;
    max-height: 300px;
    overflow-y: auto;
}
.school-result-item {
    padding: 12px 16px;
    border: 1.5px solid #e3e3e3;
    border-radius: 10px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s;
    background: #fafafa;
}
.school-result-item:hover {
    border-color: #17a2b8;
    background: #e7f9fc;
    transform: translateY(-2px);
}
.school-result-item.selected {
    border-color: #17a2b8;
    background: #e7f9fc;
    box-shadow: 0 0 0 3px rgba(23, 162, 184, 0.1);
}
.school-result-name {
    font-size: 14px;
    font-weight: 600;
    color: #111;
    margin-bottom: 4px;
}
.school-result-location {
    font-size: 12px;
    color: #666;
}
.school-not-found {
    margin-top: 16px;
}
.info-box {
    padding: 15px;
    border-radius: 12px;
    border-left: 4px solid;
}
.search-loading {
    text-align: center;
    padding: 20px;
    color: #666;
    font-size: 13px;
}
.no-results {
    text-align: center;
    padding: 20px;
    color: #666;
    font-size: 13px;
}
@media (min-width: 640px) {
    .school-result-item {
        padding: 14px 18px;
    }
    .school-result-name {
        font-size: 15px;
    }
    .school-result-location {
        font-size: 13px;
    }
}